Understanding the Little's law and throughput calculator — concept and principle
Little's law links three numbers that describe any stable system where work arrives, waits or is processed, and leaves: how much is in the system, how fast it flows, and how long each item stays. In software it answers questions such as how many concurrent requests a service holds, how big a connection or thread pool must be, and how many requests a day a given throughput implies.
How it is calculated
- Concurrency L = throughput λ (requests/s) × average latency W (s). Latency entered in milliseconds is divided by 1,000.
- Requests per day = λ × 86,400 (seconds in a day).
The principle
Little's law, L = λW, was proved by John Little in 1961. It holds for long-run averages in any system where arrivals equal departures, whatever the distribution of arrival times or service times, and without assuming a particular queueing model. The intuition: if 10 people enter a shop every minute and each stays 6 minutes, there must be about 60 people inside on average. Rearranged, it also gives throughput = concurrency ÷ latency, which is why a fixed pool of workers can serve more requests per second only if each request finishes faster.
Worked example
- Inputs: λ = 500 requests/s, W = 120 ms.
- Latency in seconds: 120 ÷ 1,000 = 0.12 s.
- Concurrency: 500 × 0.12 = 60 requests in flight on average.
- Requests per day: 500 × 86,400 = 43,200,000.
| Throughput (requests/s) | Concurrent requests in flight |
|---|---|
| 125 | 15 |
| 250 | 30 |
| 375 | 45 |
| 500 | 60 |
| 625 | 75 |
| 750 | 90 |
| 1,000 | 120 |
How to read the result
L is an average, not a peak. Size thread pools, database connections or worker counts above it, because traffic bursts and latency spikes push the instantaneous number higher. If latency doubles at the same throughput, concurrency doubles, which is a common way overloaded services run out of connections. Conversely, if a pool is capped at N slots, the maximum sustainable throughput is N ÷ W.
Common mistakes
- Using peak latency (p99) with average throughput; the law relates averages.
- Mixing units, such as milliseconds with requests per second.
- Applying it while the system is not stable, for example during a growing backlog.
- Treating the daily total as the design load when traffic is uneven during the day.
Frequently asked questions
How many threads do I need for 500 requests/s at 120 ms?
On average 60 are busy; add headroom for bursts and slow requests, and check whether threads block on I/O.
Does Little's law work for queues only?
No. It applies to any boundary you draw: a queue, a server, a whole data centre, or an inventory warehouse.
Can I use it to estimate latency?
Yes. If you measure average concurrency and throughput, W = L ÷ λ.
Sources: J. D. C. Little, A Proof for the Queuing Formula: L = λW, Operations Research 9(3), 1961 · L. Kleinrock, Queueing Systems, Volume 1: Theory, Wiley, 1975