Quant Memo
Advanced

The M/M/1 Queue and Waiting-Time Distributions

A single-server queue with random arrivals and random service times has a wait time that doesn't grow smoothly as the server gets busier — it blows up, and the M/M/1 model is the cleanest way to see exactly how.

Prerequisites: Queueing Theory and Birth-Death Processes, Little's Law

Picture a single checkout line at a small grocery store. Customers arrive at random, unpredictable moments. The cashier serves each one in a random amount of time — some transactions are quick, some take forever because someone can't find their card. If you asked "how long will the average customer wait," you might guess the answer depends smoothly and gently on how busy the store is. It doesn't. A store running at 50% of its checkout capacity has short lines. A store running at 95% of capacity — seemingly "almost fine" — has customers waiting an order of magnitude longer, not because anything catastrophic happened, but because randomness compounds violently as a system approaches full utilization. The M/M/1 queue is the simplest mathematical model that makes this blowup precise, and it shows up everywhere a resource serves random requests one at a time: an exchange's matching engine, a market maker's quote-update pipeline, a single execution algorithm working one order at a time.

The setup, one symbol at a time

"M/M/1" names three things about the queue. The first M means arrivals happen according to a Poisson process with rate λ\lambda ("lambda") — customers (or orders, or requests) arrive one at a time, at random moments, with λ\lambda events happening per unit time on average, and the gaps between arrivals are memoryless (exponentially distributed). The second M means service times are also exponentially distributed, with rate μ\mu ("mu") — the server finishes an average of μ\mu customers per unit time it's working, and like the arrivals, how long the current customer has already been served tells you nothing about how much longer they'll take. The 1 means there is exactly one server.

The single most important derived quantity is the utilization, or traffic intensity:

ρ=λμ\rho = \frac{\lambda}{\mu}

In words: utilization is the ratio of how fast work arrives to how fast the server can do it. If ρ<1\rho < 1, the server can keep up on average and the queue reaches a stable, steady-state length. If ρ1\rho \geq 1, work arrives faster than it can be cleared and the queue grows without bound. Assuming ρ<1\rho < 1, the steady-state formulas for an M/M/1 queue are:

L=ρ1ρ,W=1μλL = \frac{\rho}{1-\rho}, \qquad W = \frac{1}{\mu - \lambda}

LL is the expected number of customers in the system (waiting plus being served) once things have settled into steady state. WW is the expected total time a customer spends in the system, waiting plus being served. These two are tied together by Little's Law, L=λWL = \lambda W — in words, the average number of items in a system equals the arrival rate times the average time each item spends there, a relationship that holds for essentially any stable queue, not just M/M/1.

utilization ρ → 1 wait asymptote at ρ=1 ρ=0.5 ρ=0.95
Expected wait as a function of utilization. The curve is nearly flat through moderate utilization, then rises explosively as ρ approaches 1 — the queue doesn't degrade gracefully, it degrades suddenly.

Expected wait in an M/M/1 queue scales like ρ/(1ρ)\rho/(1-\rho), not like ρ\rho — it is nearly flat at low utilization and shoots toward infinity as utilization nears 100%. A system "90% as busy" as another can have a wait many times longer, not 90% as long.

Distribution · poisson
mean 4.0024681012outcomes (k) →
mean 4.00std dev 2.00peak at k = 3

Adjust the rate parameter in the explorer above and watch the shape of the Poisson distribution change — this is the distribution governing arrivals in an M/M/1 queue; the wait-time blowup in the figure above comes from the interaction between this arrival randomness and the server's own randomness, not from either one alone.

Worked example 1: a market maker's quote-update queue

Suppose a market maker's system receives quote-update requests at λ=8\lambda = 8 per second (Poisson) and its single processing thread handles requests at μ=10\mu = 10 per second (exponential service time, average 1/μ=0.11/\mu = 0.1 seconds each). Utilization is ρ=λ/μ=8/10=0.8\rho = \lambda/\mu = 8/10 = 0.8. Expected number of requests in the system: L=ρ/(1ρ)=0.8/0.2=4L = \rho/(1-\rho) = 0.8/0.2 = 4 requests, on average, either waiting or being processed. Expected total time a request spends in the system: W=1/(μλ)=1/(108)=1/2=0.5W = 1/(\mu-\lambda) = 1/(10-8) = 1/2 = 0.5 seconds. Check with Little's Law: L=λW=8×0.5=4L = \lambda W = 8 \times 0.5 = 4 — matches exactly.

Worked example 2: what happens as utilization creeps up

Keep μ=10\mu = 10 fixed and raise λ\lambda from 5 to 9.5, watching W=1/(μλ)W = 1/(\mu-\lambda):

  • λ=5\lambda = 5: ρ=0.5\rho = 0.5, W=1/(105)=0.20W = 1/(10-5) = 0.20 seconds.
  • λ=8\lambda = 8: ρ=0.8\rho = 0.8, W=1/(108)=0.50W = 1/(10-8) = 0.50 seconds — 2.5x the wait at ρ=0.5\rho=0.5, even though ρ\rho only rose by 60% relative.
  • λ=9\lambda = 9: ρ=0.9\rho = 0.9, W=1/(109)=1.00W = 1/(10-9) = 1.00 second — double again.
  • λ=9.5\lambda = 9.5: ρ=0.95\rho = 0.95, W=1/(109.5)=2.00W = 1/(10-9.5) = 2.00 seconds — double again, from a 5-percentage-point rise in ρ\rho.

Utilization went from 0.5 to 0.95 — less than double — while wait time went from 0.20 to 2.00 seconds, a tenfold increase. That is the ρ/(1ρ)\rho/(1-\rho) shape: nothing catastrophic happens to ρ\rho itself, but 1ρ1-\rho, the thing in the denominator, is shrinking toward zero, and dividing by a number approaching zero is what produces the blowup.

What this means in practice

  • Capacity planning near "busy but fine" is dangerous. A system running comfortably at ρ=0.6\rho=0.6 that grows its load to ρ=0.85\rho=0.85 hasn't gotten "somewhat slower" — its wait time has likely tripled or more. Sizing infrastructure with headroom well below ρ=1\rho=1 isn't conservatism, it's the only way to keep tail latency bounded.
  • The waiting-time distribution, not just its average, is exponential with rate μλ\mu - \lambda — meaning wait times are themselves highly variable, and occasional very long waits are expected even when the average wait looks tame, which matters for latency-sensitive execution and matching-engine design.
  • Single-server bottlenecks (the "1" in M/M/1) are the worst case. Splitting one busy queue into several parallel servers (an M/M/c queue) tends to reduce wait dramatically for the same total capacity, which is why systems add parallel processing threads rather than speeding up one thread.
  • The Poisson/exponential assumptions are a deliberate simplification. Real arrival and service processes are rarely perfectly memoryless; when they're not, the more general M/G/1 (Pollaczek-Khinchine) or G/G/1 (Kingman) formulas are needed, but the qualitative blowup-near-ρ=1\rho=1 behavior persists across all of them.

The classic confusion: assuming average wait time scales roughly linearly with utilization ρ\rho — "we're running 10% busier, so waits should be about 10% longer." They don't. Wait scales like ρ/(1ρ)\rho/(1-\rho), which is nearly flat for small and moderate ρ\rho and then diverges as ρ1\rho \to 1. The relevant quantity to watch isn't ρ\rho itself but how close 1ρ1-\rho is to zero — that's the number that's actually driving the wait, and it can shrink dramatically from what looks like a modest increase in load.

Related concepts

Practice in interviews

Further reading

  • Ross, Introduction to Probability Models (ch. 8, Queueing Theory)
  • Kleinrock, Queueing Systems, Vol. 1
ShareTwitterLinkedIn