Determining the Number of Concurrent Virtual Users for Load Testing

Determining the Number of Concurrent Virtual Users for Load Testing

16 July 2024 Stephan Petzl Leave a comment QA

When conducting performance testing on web applications, one of the key challenges is translating real-world traffic into simulated traffic for load tests. A common scenario involves an eCommerce site where users engage in activities such as adding items to their shopping cart, logging in, updating shipping information, and completing purchases.

Understanding the Scenario

Consider an example where a client reports 1000 shopping carts created per hour, with a total of 10,000 over 24 hours. Not all carts are completed, but all go through some part of the checkout process. The “think time” per page is approximately 30 seconds.

Key Questions to Ask

Before determining the number of concurrent virtual users, it’s crucial to gather more information about user behavior. Here are some questions to consider:

  • What is the duration of sessions for users who complete purchases?
  • How many completed carts are from first-time shoppers creating an account?
  • What is the average duration for users who abandon their carts?
  • How many items are in the average shopping cart?
  • How many items are in abandoned carts on average?

Creating Scenarios

Based on the answers to the above questions, you can create different scenarios. For instance, you might have separate scenarios for first-time shoppers, returning shoppers, and users who abandon their carts.

Example: Returning Shopper Scenario

Assume a returning shopper takes 10 minutes on average to complete a purchase, with a low of 5 minutes and a high of 15 minutes. If 3/4 of users are returning shoppers, you can configure your load test as follows:

  • Set the script to run in 10 minutes on average with think times adjusted to match this duration.
  • Randomize think times to vary by +/- 50%.

Calculating Virtual Users

To simulate this scenario during a peak hour:

  • For a returning user script that takes 10 minutes, a single virtual user can run the script 6 times in an hour. To achieve 300 iterations, you need 50 virtual users (50 * 6 = 300).
  • For an abandoned cart scenario taking 4 minutes, each virtual user can perform 15 iterations in an hour. To achieve 600 iterations, you need 40 virtual users (600 / 15 = 40).
  • For a new user scenario taking 15 minutes, each virtual user can run 4 iterations in an hour. To achieve 100 iterations, you need 25 virtual users (100 / 4 = 25).

Thus, you need a total of 115 virtual users to model the peak hour load.

Scaling the Load

If your client wants to test the site under four times the current load, you can scale up the number of virtual users proportionally. In this case, you would need 460 virtual users (4 * 115 = 460).

Practical Application

Implementing these strategies can significantly enhance the accuracy and reliability of your performance tests. For further guidance on running test batches and handling test exceptions, refer to our documentation:

Enhancing Load Testing with Repeato

To streamline your testing process, consider using Repeato, a no-code test automation tool for iOS and Android. Repeato allows you to create, run, and maintain automated tests efficiently, leveraging computer vision and AI. It’s particularly fast to edit and run tests, making it an excellent choice for quality assurance without the need for extensive coding knowledge.

Like this article? there’s more where that came from!