Calculating Virtual Users (VUsers) for Load/Stress Testing

Frequently I will be getting this question to my mailbox, forums and even in calls. How to calculate number of virtual users (VUsers) for load/stress testing? What should be the concurrent virtual users to load? What should be the peak load?

25, 100, 500, 1000. We cannot give number of VUsers blindly which will not return intuitive result for analysis.

The main purpose of VUsers is to simulate the live environment. It is very tricky but easy to obtain number of VUsers required for the load/stress testing. Universal formula to calculate the arriving rate to the system is Little’s Law.

N = Z * (R + T)

where N – number of VUsers,

             Z – Transactions per Second (TPS)

             R – Response Time in seconds

             T – Think Time in seconds

If you get the following data from the stakeholders i.e. TPS, Response Time and Think Time, number of VUsers can be calculated easily.

E.g.      TPS is 100, R is 3 sec and T is 2 sec then N will be

            N           = 100 * (3+2)

                          = 100 * 5

                          = 500

Peak load will be 500 VUsers.

Suppose if there is no data available on TPS and Response Time, and you aware any one of the following combinations, you can use this online calculator.

  • Peak Hourly Visits and Average Visit Length
  • Peak Hourly Pages, Testcase Size and Duration

It is vital important to simulate the input data in load/stress testing. This online calculator provides how many data you would need for simulation.

About the Author

5 thoughts on “Calculating Virtual Users (VUsers) for Load/Stress Testing”

  1. Hi Naveen,
    Thanks for highlighting an interesting testing topic in a detailed, very simple, structured and useful manner. As we are calculating No. of virtual users for our load test but when we do performance testing, we never tested the application against any specific user set; we always perform different user tests to determine the system state at different loads. Now my question is,
    How to use these virtual users’ calculations in our performance test?

    Secondly, I am working in an independent software testing company and have executed few performance testing projects. The culture here is, client provide us the URL and ask to do the performance testing without providing any information (due to limited technical knowledge). So in that case we use incremental approach to test the application by increasing the virtual users test by test. Please suggest me,
    What will be the best strategy for virtual users’ calculation in this case?

    Reply
    • Sajid,

      You need to get atleast any two info such as N, Z or R. Just get the info from developers. They must be able to get relevant info. Performance Testing without any objective, is of no use.
      If you don’ have any thing, my suggestion is just try to perform stress testing to identify the breaking point.

      Thank you!
      http://QAInsights.com

      Reply
  2. Naveen,

    As per jmeter diff. fields which are equal to Z , R and T? I mean can we get these all 3 times by running test in jmeter?

    Reply
  3. Hi,

    The little explains how to get the vusers for the load test with the formula
    but to TPS, Response time and think time on which bases we are getting this metrics

    What I mean to ask is that We have to do a baseline test with one user one iteration to get the TPS, Think Time and Response which will give us the no of Vusers?

    Please let me know

    Kind Regards
    kirankumar

    Reply

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Hamster - Launch JMeter Recent Test Plans SwiftlyDownload for free
+
Share via
Copy link