Tuesday, March 6, 2007

Importance of Little's Law

Little's law is quite simple and intuitively appealing.

The law states that the average number of customers in a system (over some time interval), N, is equal to their average arrival rate, X, multiplied by their average time in the system, R.

N = X . R (or) for easy remembrance use L = A . W

This law is very important to check whether the load testing tool is not a bottleneck.
For Example, in a shop , if there are always 2 customers available at the counter queue , wherein the customers are entering the shop at the rate of 4 per second , then time taken for the customers to leave from the shop can be calculated as

N = X. R

R = 2/4 = 0.5 seconds


A Simple example of how to use this law to know how many virtual users licenses are required:

Web system that has peak user load per hour = 2000 users
Expected Response time per transaction = 4 seconds
The peak page hits/sec = 80 hits/sec

For carrying out Performance tests for the above web system, we need to calculate how many number of Virtual user licenses we need to purchase.

N = X . R
N = 80 . 4 = 320

Therefore 320 virtual user licenses are enough to carry out the Load Test.

5 comments:

Naren said...

Pretty scientific ramya, really awesome calculation !!!

Ryan Fernandes said...

Nice!
One though though: I will surely profit from running 2000 users (logged in) as the memory dynamics will be more pronounced as compared to 320 users.

Andrew said...

Hi

You can also use Little's law to work out the concurrent number of users performing a transaction.

Have a look at http://www.1202performance.com/2009/09/calculating-concurrency-from-performance-test-results/

Unknown said...

Very useful mathematical approach. Thanks for the information

Varun Srivastava said...

Thanks Ramya.
Now i got very good tips.
Its very useful.