Little's Law, with a worked example
Little's Law says that the average number of items in a system equals the rate they arrive multiplied by the average time each one spends there. It holds for any stable system over a long enough period, whatever the distribution of arrivals or response times, which is why it is the starting point for sizing a load test.
For a load test, the items are virtual users and the time in the system is a whole user cycle: the response time plus the think time before the next action. An API with a target of 250 requests per second and a 180 ms response time, called by clients that send the next request straight away, has 250 × 0.18 = 45 requests in progress at any moment, so 45 virtual users can produce that load. A web journey with 100 users, a 0.5 s response time and 10 s of think time produces 100 ÷ 10.5 = 9.52 transactions per second.
Little's Law
L = λ × WItems in the system = arrival rate × time each item spends in the system.
For a closed load test
users = throughput × (response time + think time)Rearranged, throughput = users ÷ (response time + think time), and response time = users ÷ throughput − think time.