By Tri Nguyen from Ho Chi Minh City Software Testing Club
When starting a performance testing plan, we often ask how many concurrent users are enough for our test runs? Your answers maybe one hundred concurrent users? A thousand? Ten thousands? But how exactly can you estimate these numbers for your test plan? Which data do you base on to determine them? I hope the following calculations will help you to get reasonable answers.
- 80% of the traffic comes between 7AM and 11AM. Hence, the number of unique visitors between 7-11Am = 80*50k/100 = 40k
- 20% in the other times.
Now that you know how many unique visitors you’ll get in an hour, you can start turning that in to concurrent users. To do that, it’s important to assume that a unique visitor is roughly equivalent to a transaction. So really you want to figure out how many users you need to reach 10K transactions in an hour.
Suppose your script (or scripts) takes an average of 2 minutes to complete a transaction (the average time should include human think time) with the actions such as log in, navigate to a page, click download and log out. In other words, we can understand it as the average time of a unique user staying on your site. That means a single user will execute (60/2) = 30 transactions in an hour. So to reach 10K transactions, you’d need (10k/30) = 333 users.
Of course, these calculations only help you to estimate the number of concurrent users for a general load in a typical day (assuming your website has 20% of total traffic in an hour).
Your traffic patterns may vary, or you may want to prepare for a larger surge in the future. But you can repeat the above steps to estimate.