What it is
Little's law relates three averages of any system with a boundary around it:
- λ (lambda): the rate at which requests pass through the boundary, in requests per second (the throughput).
- W: the average time a request spends inside, from entering to leaving, in seconds.
- L: the average number of requests inside at any moment.
For a stable system: L = λ × W. A service that completes 400 requests per second, each spending 250 ms inside, holds 400 × 0.25 = 100 requests on average. Written the other way, W = L ÷ λ and λ = L ÷ W.
John Little proved it in 1961. It is an accounting identity about long-run averages, which is why it needs no assumption about how requests arrive, how long they take, or in what order they are served.
Why it exists
Engineers constantly need one of the three numbers and have the other two: how many connections a database needs (L) given the query rate and the time a connection is held; how long requests take (W) given how many are in flight and the throughput; what rate a system is really sustaining (λ) given its concurrency and latency. The law turns monitoring data you already have into the number you lack, and it is a sanity check: if the three numbers you measure do not agree, one of them was measured on a different boundary, or the system is not stable.
How it works
A worked example. An API receives 120 requests per second and each request spends about 51 ms between the user sending it and the answer coming back (5 ms there, 40 ms of work, 5 ms back, almost no waiting). L = 120 × 0.051 ≈ 6 requests are in the system on average. In the lesson's simulation the average number in the system is measured by sampling every 100 ms and matches that product.
Sizing concurrency. The requests that are in service need a worker, thread or connection each. With 120 requests per second and 40 ms of service, 120 × 0.040 = 4.8 workers are busy on average, so you need more than 4.8: the server in the lesson has 8, which is 60% busy. The Server Capacity calculator in this lab shows the same figure as "requests in progress" (CPU time only). Averages are a floor, not a size: bursts and variation put the instantaneous number well above the average.
L grows faster than traffic. At 180 requests per second (+50%) the server is about 90% busy and requests begin to queue, so W rises as well and L roughly doubles. The law is always true; it just says L follows both factors. This is why pools that were comfortable at moderate load run out as traffic approaches capacity.
Choose the boundary first. The law holds for any boundary, but L, λ and W must describe the same one:
- The user's view (send to answer): W = 51 ms, L ≈ 6.
- The server's workers only: each request occupies a worker for the 40 ms of service, L = 120 × 0.040 = 4.8 busy workers.
- The waiting line only: Wq is a millisecond or two, so Lq ≈ 0.1.
Mixing them produces wrong answers: multiplying λ by the user's W and calling it busy workers overstates them, and a gauge that counts requests from the moment a load balancer accepts them will not match an application timer that starts later.
Effective throughput. λ is the rate of the flow whose time-in-system is W. If a server can finish 200 requests per second, is offered 260 and rejects the rest at its door, the served requests spend about 140 ms in the system (they wait behind a full queue): L = 200 × 0.14 ≈ 28. Using the offered 260 gives about 35, which is 25–30% too high, because the rejected requests were never inside for 140 ms. Latency percentiles and averages in this lab count successful requests only; the error rate is shown beside them for exactly this reason.
Stability. The identity holds for averages over a long enough period in a system whose averages exist: arrivals roughly equal departures, and the amount inside does not grow without bound. It also assumes that, over the period you measure, requests that started before it began and are still inside at its end are a small part of the total. If arrivals exceed capacity and the queue is unbounded (260 per second offered, 200 per second served, nothing rejected) none of that is true: the backlog grows by about 60 requests per second, every request waits longer than the one before it, and L and W grow without limit. Throughput stays at 200 per second, W is large and rising, and L stays about 30% above λ × W because requests still waiting are counted in L but are not yet in the completed requests' W. The law is not wrong; it just does not predict a settled value, and every reading depends on when you took it.
When to use it
- Sizing thread pools, connection pools, worker counts and in-flight limits from rate and time (with headroom for bursts).
- Cross-checking monitoring: in-flight gauge, request rate and latency should agree on one boundary.
- Estimating throughput from concurrency and latency when you can measure those directly (for example a load test with a fixed number of virtual users).
- Reasoning about how much memory or how many sockets a service needs per unit of traffic.
When not to
- As a prediction of latency or tail latency: it relates averages and says nothing about the distribution; use queueing formulas and load tests for that.
- On a system that is visibly not stable: growing queues, an ongoing ramp or a recent failure. Measure a stable stretch or reason about the transient explicitly.
- With figures taken from different boundaries or different populations (all requests for L, successful requests only for W) without saying so.
Trade-offs
| You choose | You gain | You must watch |
|---|---|---|
| The user's view as the boundary | What users experience, including network and queueing | Network and client time you do not control |
| Only the server's workers | Exactly the concurrency to provision | It hides queueing delay before the worker |
| Effective throughput for λ | A correct L for the flow that completes | Rejected and timed-out traffic needs its own accounting |
| Successful requests for W | A latency that describes finished work | Survivor bias: failing the slow requests lowers W |
Alternatives
- Utilisation law and other operational laws (U = X × S, the forced-flow law): similar identities that also need only measured averages.
- Queueing models (M/M/1, M/G/1, M/M/c): predict W from λ and S, including how it explodes near full utilisation (see Queueing Fundamentals).
- Load testing: measure the real relationship between concurrency, throughput and latency for your system.
Failure modes
- Offered rate as λ: sizing from the rate clients send rather than the rate the system completes overstates L whenever anything is rejected or times out.
- Mixed boundaries: an in-flight gauge from one tier compared with latency from another, then blaming the law when the numbers disagree.
- Averages as pool sizes: a pool of exactly L connections queues constantly, because arrivals are bursty and service times vary.
- Reading a transient as a steady state: taking one window during a ramp or an overload and treating the numbers as a baseline.
- Survivor bias: a short timeout turns the slowest requests into errors, so the average latency of successes falls while reliability falls with it.
In production
Use the law to turn a latency SLO and a target rate into a concurrency budget (connections, threads, in-flight limits), then add headroom for bursts and for losing an instance. Name the boundary in dashboards ("in flight at the load balancer", "busy workers", "queued"), and chart arrival rate, completion rate and in-flight together: a widening gap between arrivals and completions is the first sign that a system has stopped being stable. Alert on the error rate next to latency, never on latency alone.
Common misconceptions
- "Little's law needs Poisson arrivals or exponential service times." It needs neither.
- "Doubling the traffic doubles the concurrency." Only if W stays constant; near saturation W grows too, and L grows faster than λ.
- "L is the number of busy workers." Only if the boundary is the workers; the user's view includes network time and waiting.
- "If the numbers do not satisfy the law, the law is wrong." Check the boundary, the throughput definition (effective vs offered), the latency population and stability first.
Interview angle
State the formula, then name the boundary: "at 5,000 requests per second with 200 ms per request, about 1,000 requests are in flight; if each holds a connection for the whole time, that is the floor for the pool". Show you know the traps: use effective throughput, say whether latency covers failures, and note that overload with an unbounded queue never reaches a steady state, so the first fix is bounding the queue or shedding load, not computing a bigger L. Pair it with ρ and the hockey-stick curve from Queueing Fundamentals.
Model assumptions
The simulation is a simplified model, not a benchmark, and runs entirely on the lab's existing engine (nothing is scripted). Users send Poisson traffic over a 5 ms link to one API server with 8 workers, a 40 ms mean service time (lognormal, cv 0.3) and a bounded queue (100 waiting requests; 20 in the effective-throughput step; effectively unlimited in the overload step), so it can finish about 200 requests per second; the way back is another 5 ms. The boundary is the user's view: a request is in the system from the moment it is sent until its answer or failure returns. L is the time-average number of such requests, sampled every 100 ms over the last 5 simulated seconds; W is the mean latency and λ the throughput of requests that succeeded in that window (population: successes only, window: 5 s). λ × W is computed from those two tiles. The 4.8 busy workers and 0.1 waiting requests in the boundary step are the same law applied to other boundaries; they are stated in the text and checked in the lesson's tests, not shown as tiles. Rejected requests are in the system for a few milliseconds and are in L but not in W, a small difference the effective-throughput step mentions. Averages over a 5 s window fluctuate by several percent; the text rounds accordingly. In the overload step the simulation runs at normal speed so the growth is visible; the model has no timeouts or retries there, which a real client would add. Numbers show behaviour and orders of magnitude only. Latency percentiles and averages are computed over successful requests; failed, rejected and timed-out requests are counted in the Errors tile, which is always shown next to them.