Monday, August 06, 2012

Web Load Testing: When you can come up with single test user



All the measurements contain certain error. You will never get absolutely accurate value, so the only thing you can do with that is to accept that. 

When you perfrom load testing of your web aplpication it is usually strongly recommended to use different user for each thread and it is quite reasonable. However in some cases you may consider the results reliable even if you use single credential to login for several threads. So how do you know if you can manage with the single test user. First of all you should figure out what you want to measure and what technologies you use.

The generic problem of single credential implies the server performs some data processing once the user requests the server resources the first time and then uses pre-evaluated data not spending the time for other requests. This highly depends on the technologies you use, on whether they support caching or whether they are so called statefull. 

HTTP server is orginally stateless machine. That means that all the "state" matters are supported by injecting so called cookies into the client browser. All the tools for load testing support completely isolated sessions for each thread. That's why some of the functional areas can be loaded with the help of only one user.

The good examples are 
  • loading any static resource such as
    • web pages
    • files
    • other data streams
  • displaying the page with dynamic data not depending on the person looking at it
  • simple chat rooms (surprisingly)
  • authentication/authorization (again surprisingly). Even if your database caches requests you rather load HTTP server on authentication/authorization phase than a db server. So lot of threads will show you the problems (if they are) in your HTTP container configuration despite your db server will be still feeling okay.

All these points do not ensure your success but rather are aimed to make you focus your attention on whether the architecture of your application is suitable for testing with single credentials. Each application is unique so you are still responsible for decision.