← All animations

🚶 Queues & Little's Law

Lines form whenever work arrives faster than it can be cleared. Queueing theory says something deeply counter-intuitive: the wait doesn't grow smoothly as you get busier — it explodes. Pushing a system from 80% to 95% utilisation can multiply the wait many times over. Scroll through to watch a queue come alive, see the wait rocket toward infinity near full capacity, and check the elegant accounting law (L = λ·W) that ties it all together.

1. A live queue — arrivals λ, service μ, utilisation ρ

Customers arrive at the left at average rate λ and join the line. A free server pulls the next customer, serves them for a random time (average rate μ), then they leave at the right. Both arrivals and service are random (exponential). The single number that matters is utilisation ρ = λ / (c·μ) — how full the system is. Push the arrival rate up toward capacity and watch the line stop draining.

ρ = 0.70 In line: 0 In system: 0 Avg wait W: 0.0

2. Why "almost full" is a trap — the wait curve

Average wait is roughly proportional to 1 / (1 − ρ). That term is gentle for a while, then turns nearly vertical as ρ approaches 1. Going from 50% to 75% busy barely doubles the wait; going from 90% to 98% can multiply it tenfold. The hollow marker is the live measurement from the simulation above — drag its λ slider and watch your operating point climb the wall.

Operating point: ρ = 0.70 Wait vs. an empty system: 3.3×
Practical systems are usually run at 85–90% utilisation, not 99%. The last slice of capacity buys almost nothing useful and costs enormous, unpredictable waits. And real-world variability (bursty arrivals, uneven service times) pushes the wall in even closer — the smooth curve here is the optimistic case.

3. Little's Law — L = λ · W

One of the most useful results in all of operations: in any stable queue, the average number of customers in the system (L) equals the arrival rate λ times the average time each one spends there (W). It needs no assumptions about the arrival pattern — just that the system is stable. Watch the measured L track λ·W as the simulation runs.

0.00
L — avg in system (measured)
=
0.00
λ — arrival rate
×
0.00
W — avg time in system
λ·W = 0.00  ≈  L = 0.00
The blue trace is measured L; the gold trace is λ·W computed from the same run. They converge.