Free — no signup required

Little's Law: The Golden Rule

2 min read

The Formula

In 1961, John Little proved a theorem that is deceptively simple but holds for any stable system — no assumptions about arrival patterns, service time distributions, or queue discipline required:

$$L = \lambda W$$

  • $L$ (Length): The average number of items inside the system at any moment (both waiting in queue and actively being served).
  • $\lambda$ (Lambda): The average arrival rate of new items (e.g., requests per second, jobs per minute).
  • $W$ (Wait): The average time a single item spends in the system from arrival to departure (i.e., total latency, including queue wait and service time).

Why It's Useful

You can measure any two of these values and calculate the third. This makes Little's Law a powerful diagnostic tool.

Example 1 — Sizing concurrency:
Your API server handles 100 requests/sec ($\lambda = 100$) and your p50 latency is 0.5 seconds ($W = 0.5$). How many concurrent requests must your server support at any moment?

$$L = 100 \times 0.5 = 50 \text{ concurrent requests}$$

This tells you to size your thread pool, connection pool, or goroutine limit to at least 50. If you cap it at 20, you'll start rejecting or queuing requests even at normal load.

Example 2 — Diagnosing a slowdown:
Your monitoring shows $L$ (active requests) jumped from 50 to 200, but $\lambda$ (arrival rate) didn't change. Rearranging: $W = L / \lambda = 200 / 100 = 2$ seconds. Latency quadrupled. Something is wrong with service time — a slow database query, a lock contention, a downstream dependency timing out.

Example 3 — Capacity planning:
You want to support 500 req/sec at a target latency of 200ms. How many concurrent request slots do you need?

$$L = 500 \times 0.2 = 100 \text{ concurrent slots}$$

Plan your infrastructure around this number.

Interview Tip

Interviewers at senior/staff level often ask: "Your p99 latency spiked but your request rate didn't change. How do you diagnose this?" A strong answer invokes Little's Law: if $\lambda$ is constant but $W$ increased, then $L$ (concurrency) must have increased too. This points to a service-time problem (slow downstream, GC pause, lock contention) rather than a traffic spike. Framing your answer with $L = \lambda W$ signals mathematical rigor.

This is one of 18 chapters

Every chapter is free — Kubernetes, Terraform, SRE, distributed systems, and more — with fast daily review built in.

Sign up free