Overload and queueing theory basics
Little's law, utilisation and why latency explodes as a system approaches full capacity.
20 min readLittle's law
For any stable system, the average number of requests in flight L equals the arrival rate lambda times the average time each spends inside W: L = lambda x W. It needs no assumptions about distributions, which makes it a practical sizing tool. At 2 000 requests per second and 50 ms average latency, 100 requests are in flight; if latency rises to 500 ms, 1 000 are in flight, so you need ten times the threads, connections and memory just to hold the same traffic.
Utilisation and the latency curve
Queueing delay is not linear in load. In the simple single-server model, time in the system grows with 1 / (1 - utilisation): compared with an idle server, a request takes about 2 times as long at 50% utilisation, 5 times at 80%, 10 times at 90% and 20 times at 95%. Real systems with bursty arrivals behave the same way or worse. This is why capacity plans aim for 60 to 70% utilisation at peak: the last 30% buys latency stability, not waste.
How overload becomes collapse
When arrivals exceed capacity, the queue grows without bound and latency grows with it. Users and clients time out, but the server keeps processing their abandoned requests, so useful throughput (goodput) falls even while the CPU is at 100%. Retries then add more arrivals. The result is congestion collapse: the system is fully busy doing work nobody wants, and it stays that way after the original spike passes.
Design implications
Queueing theory turns into concrete rules. Each one stops the system from accepting more work than it can finish within the time clients are willing to wait.
- Bound every queue; an unbounded queue just converts overload into latency and memory exhaustion
- Drop requests that have already waited longer than the client's timeout
- Under overload, serving newest requests first (LIFO) keeps some users fast instead of all users slow
- Watch queue depth and in-flight count as early warnings, not just CPU
Key takeaways
- Little's law: in-flight requests = arrival rate x latency
- Latency grows like 1 / (1 - utilisation), so leave 30 to 40% headroom at peak
- Unbounded queues turn overload into collapse; bound them and drop stale work
- Goodput, not CPU, tells you whether an overloaded system is doing useful work
Sign in to track lessons and earn badges.