Performance testers, depend on the business teams to give the idea about the concurrent user load required for the application to be tested. If only, life would be that easy. In most scenarios, the information regarding the number of concurrent users (and the steady state time for those) is not available with the business teams. Translating the information of real time user load into simulated load is tricky. Also the performance test environments are scaled down as compared to that with the production. In such situations, the business expects the performance test team to come up with the information regarding the number of users to test and the duration of the test and here comes an article that can help you with that.
Let’s assume some basic items while simplifying this task –
Let’s look at the formula that we will use to calculate the number of users –
Number of virtual users = Length of user scenario (in sec) * Number of requests per second required
To further understand, let’s consider an example. -> Peak load on an application is 10 users per hour and each user on an average spends 10 mins on the website and goes through 10 web pages. This means the implemented user scenario will contains 10 page-requests and each virtual user will run for 10 minutes.
The above formula in such cases gets modified to:
Number of virtual users = Number of users per hour * Number of requests per user * 3600 / [Length of user scenario (in sec)]
Hence using above formula:
Number of virtual users = 10 * 10 * 3600 / 600 = 600
Hence the above formula gives a user count of 600 users. However a noticeable point is in an hour a user runs for only 10 mins and is inactive for most of the time. Moreover tool licensing are planned in such a way that more the number of concurrent users you require, more is the cost of license. Thus we need a better way of calculating the required load in such a way that the production load is met without increasing the cost of the tool (and thus the test). Instead of keeping the users idle for 50 mins out of 1 hour of the test, if same user is made to perform the task of multiple users and thus create load without impacting the load, the concurrent vuser load required can be substantially reduced.
Eg. In above scenario, if after 10 mins, a virtual user is made to make multiple iterations and thus make 6 iterations in an hour the number of concurrent users required (for the performance test) can be substantially reduced to 100 vusers.
This user load can be further reduced by reducing the thinktime and thus increasing the transaction load (per unit time). However it is not the best approach since it doesn’t help to create the accurate production like scenario and is coupled with multiple issues. Here is why this reducing think time approach should not be followed -(See our article Number of Virtual Users – An unavoidable parameter while designing performance tests )
Thus on an average the above formula provides a pretty good way to calculate the user load and design the test. Do give it a try and post your comments on the experience.
This post is also available in: French