concurrent users

Yesterday a customer called me to ask about how his current traffic levels translate to the load he should use for performance testing. We discussed it in several ways, and he said I had been helpful. This morning he sent me an email with a fantastic suggestion to write a blog post about our discussion.

The focus is to determine how many virtual users someone should use in their load tests. Sounded good to me, and here is how he framed the question in the email:

For example, while looking at Google Analytics for a given average day, during a peak hour we had:

  • 2000 visitors in 60 minutes
  • 10,000 page views
  • avg page views 5
  • avg time on site 7 minutes

So I wanted to figure out how many users should we feed the LoadStorm system to simulate this traffic as a base line. Does this math look correct for this case?

2000 users in 1 hour (60 minutes), 7 min time on site

60 minutes / 7 min = 8.5

2000 / 8.5 = 235 Users

Establishing an Algorithm

Well, his calculations seem to be logical and have accurate math. I would first say that a test of 235 concurrent users seems like a good baseline based on the Analytics numbers. Each test scenario should have an average duration of 7 minutes to reflect the “avg time on site” metric. That would lead to the conclusion that the total number of users turned over about 9 times during the hour. Put another way, the total 2,000 visitors do not translate to 2,000 concurrent users because each user only stays a few minutes. If they stayed for an hour each, then we need to test for 2,000 concurrently. They don’t stay long; therefore, dividing the 2,000 users by 8.5 (visit duration) would tell you that approximately 235 users were using the site concurrently.

This approach is going to tell us how many users we have on average. Let’s put this into a mathematical formula:

U = V / (60/D)

Where: U is the number of load test virtual users (that’s what we are trying to figure out) V is the average number of visitors per hour D is the average duration of a visitor

60 is the number of minutes in an hour

Let’s state this formula again in English like a math word problem:

Load Test Virtual Users is equal to the Average Visitors per Hour divided by the User Turnover Rate per Hour

Similar Posts