Little's Law - To Get Concurrent Number of Users 

One of the basic queuing theory principles applied in Software Performance Engineering is Little's law
(a). It states that the total number of users in the system is equal to the product of throughput and response time.

Total Number of Users = Throughput X Response Time

While calibrating your load test runs, one should always cross check the test results (throughput, response time, user-load simulated) to identify whether the load generator nodes themselves are not becoming the bottleneck in the system.

From performance test results we can easily calculate the concurrency for a particular transaction using Little’s Law.

Little’s law allows us to relate the mean number of items in the system in our case concurrent users with the mean time in the system (response time) as follows:

Number of Items in the system = Arrival Rate x Response Time

Rule to remember before you use little law you must make sure the system is balanced. That is the arrival rate into the system is the same at the exit rate.

When to Apply:
To apply little law to a performance test we must first make sure that we are taking measurements from when the system under test is balanced. Remember a balanced system the rate of work entering the system matches the rate of work leaving the system.

For a typical load testing tool: Balanced system is after the ramp up period and the number of virtual users remains constant (Steady state Period) and response times have stabilized and the transaction per second graph is level.

To capture this period of time in LoadRunner for example you would need to select the time period in the Summary report filter or under the Tools -> Options.
So record the average response time for the transaction of interest and the number of times per second the transaction is executed.

Transaction Name  SLA Status Minimum Average Maximum Std. Deviation 90 Percent Pass Fail Stop
001_Create Account 0.3231.42917.5491.8691.92988800


So from the example above the response time is 1.429 seconds. The arrival rate is the number of transactions executed divided by the duration. The duration for this example was a 10 minute period as can be confirmed by the LoadRunner Summary Below.

This gives you an arrival rate of 1.48 calculated by taking the count 888 divided by the duration 600.
So the concurrent number of users Creating an Account is 2.114

Comments

  1. What about the Think Time used during load test?

    ReplyDelete
    Replies
    1. As explained in the next topic CTotal = C+Co = R*T + R*To = R(T+To). So CTotal = R(T+To). R=C/(T+To)
      where T is time spent in the Server(response time), To is the average think time, C number of users and R the throughput.
      So the think time is included in the result.

      We can exclude the think time if you want by de-selecting the option available to include think time or not. So in the above result the think time is included.

      Delete
  2. Thanks for the info. I was bit confused with my scenario.
    I run the test with 20 users, fixed think time of 5 sec,. pacing - fixed 5 sec.. average response time is 2.5(doesnt not include think time.. ) ..trans per sec is around5...
    How it could be.. its not matching little law... M I looking something wrong?...

    ReplyDelete
  3. For Little's law to be applicable, steady state condition need to be taken into consideration. We should remove the period of ramp-up and ramp-down from the the total duration of test.
    Take the throughput, Average response time for the duration of steady-state and apply.

    ReplyDelete
  4. How to do error handling in Vugen?

    ReplyDelete
  5. Nice blog for HP Loadrunner issues faced and solutions please visit below blog
    https://performanceengineeringsite.wordpress.com/

    ReplyDelete

Post a Comment

Popular posts from this blog

Steps to Analyze AWR Report in Oracle

Vmstat Output explained

Verifications and Error Handling in LoadRunner *Web_reg_find and Web_reg_save_param*