WLM Concept
8. WLM (Workload Model) Calculation using Little’s Law
Little’s law was named after “John Dutton Conant Little” who was an Institute Professor at the Massachusetts Institute of Technology. Little’s law is a generic and simple law which can be applied not only to software systems but to any generic closed system.
Little‘s law states that the average number of requests in the system(closed) is equal to the product of average number of Requests serviced per unit time and the average time each Request stays in the system.
Little‘s law holds valid only under below conditions
– Little‘s law holds good as long as the as the Requests are not created or destroyed within the system.
– It assumes the system to be a stable system (Rate of arrival equals rate of departure)
Thus, Little‘s law can be applied to a software systems and can be rephrased as – The average number of users in a queuing system N is equal to the average throughput of system X, multiplied by the average response time of system R.
Numerically,
N = R * X
Where,
N = average number of users in a system
X = average throughput or departure rate of users
R = average time spent in the system or response time
Modifying above stated law for performance engineering and adding think time (TT)
N = (R + TT)* X
Uses of Little’s law in performance engineering and testing
1. Used for designing the test (Modelling workload) – Littles law can be used while designing the test to achieve a desired throughput and calculate appropriate think times (wait times) to be placed inside test script.
2. Used for validating the correctness of test – Every performance test should be verified for correctness by applying littles law on to the results.
Determine Concurrent Users in a performance test based on following data-
Scenario –A system at processes 1000 Transactions/Hour with an average response time of 5s per transaction. The average Think Time per user is = 10s. What is the number of concurrent users on the system?
Throughput or X = 1000/3600 = 0.27 TPS (Transactions Per Second)
From Littles Law : N = [R + TT] * X
Applying the equation: N = [ 5 + 10 ] * 1000/3600 = 4.16
The above system has approximately 4 concurrent users inside the system at any given point of time.