Quant Memo
Advanced

Heavy Traffic and Diffusion Approximations for Queues

When a queue runs close to full utilization, its behavior stops looking like discrete arrivals and departures and starts looking like a continuous random walk — letting a hard discrete problem be approximated by a much simpler diffusion process.

Prerequisites: Kingman's Formula for G/G/1 Queues, Little's Law

Simulating an order queue exactly — tracking every individual arrival, every individual service completion, one at a time — is precise but computationally heavy and gives you a jumble of numbers rather than intuition. When a server or matching system runs close to fully loaded, though, something convenient happens: the queue length, viewed from far enough away, starts to look like ordinary Brownian motion with a drift, the same random walk used to model stock prices. Heavy traffic theory says exactly when and why this happens, and it lets you swap a hard discrete queueing problem for a much more tractable continuous one.

An analogy: a crowd near a doorway

Imagine a doorway people pass through one at a time, with a crowd building up in front of it. If the doorway is mostly idle, the crowd size is small and jumps around unpredictably — no smooth pattern. But if the crowd arrives almost as fast as the doorway can let people through, the crowd size becomes a large, slowly drifting number that moves in small relative steps, buffeted by whether slightly more or fewer people arrived in the last minute than left. From a distance, that slow drifting is well described by a continuous, jittery path rather than by tracking individuals — the same simplification the eye makes watching a packed doorway from afar versus watching one person at a time.

The idea, one symbol at a time

Let Q(t)Q(t) be the number in the system (in queue plus in service) at time tt, and let ρ\rho be utilization as before. Heavy traffic means ρ1\rho \to 1: arrivals almost keep pace with service capacity. Under heavy traffic, after rescaling time and queue length appropriately, Q(t)Q(t) converges to a reflected Brownian motion X(t)X(t):

X(t)=μt+σB(t)+L(t),X(t)0,X(t) = \mu t + \sigma B(t) + L(t), \qquad X(t) \ge 0,

where B(t)B(t) is standard Brownian motion (pure random jitter, no drift), μ\mu is the drift (negative when the server has slight spare capacity, so the queue tends to drain), σ\sigma is the volatility of arrival-and-service noise (driven by the same Ca2,Cs2C_a^2, C_s^2 terms from Kingman's formula), and L(t)L(t) is a "reflecting" term pushing the process back up whenever it would go negative — a queue can't have fewer than zero people. In plain English: near saturation, the queue behaves like a stock price with a slight downward pull, continuous random noise, and a floor at zero.

The steady-state distribution of a reflected Brownian motion with negative drift μ<0\mu < 0 is exponential with rate 2μ/σ22|\mu|/\sigma^2, which recovers exactly the same ρ/(1ρ)\rho/(1-\rho)-type blow-up as ρ1\rho \to 1: as drift μ0\mu \to 0^-, the mean queue length σ2/(2μ)\sigma^2/(2|\mu|) grows without bound.

Worked example 1: matching-engine queue depth

An exchange's matching engine handles λ=995\lambda = 995 orders per second on average, with capacity μcap=1000\mu_{\text{cap}} = 1000 per second, so ρ=0.995\rho = 0.995 — deep in heavy traffic. Suppose the combined variability gives an effective diffusion parameter σ2=50\sigma^2 = 50 (orders²/second) and drift μ=(1000995)=5\mu = -(1000 - 995) = -5 per second (net drain rate). The approximate steady-state mean queue length is:

E[Q]σ22μ=502×5=5 orders in the system.\mathbb{E}[Q] \approx \frac{\sigma^2}{2|\mu|} = \frac{50}{2 \times 5} = 5 \text{ orders in the system}.

If capacity is upgraded so the drain rate improves to μ=10\mu = -10 (i.e., ρ=0.99\rho = 0.99), holding σ2\sigma^2 fixed:

E[Q]5020=2.5 orders.\mathbb{E}[Q] \approx \frac{50}{20} = 2.5 \text{ orders} .

Doubling the drain rate roughly halves the queue — the diffusion approximation gives this instantly without discrete-event simulation.

Worked example 2: a risk batch job near a deadline

An overnight risk job processes files at a rate that's 98% of the incoming rate (ρ=0.98\rho = 0.98, drift μ=0.02\mu = -0.02 files/minute in scaled units) with noise σ2=0.08\sigma^2 = 0.08. Approximate mean backlog:

E[Q]0.082×0.02=2 (scaled units).\mathbb{E}[Q] \approx \frac{0.08}{2 \times 0.02} = 2 \text{ (scaled units)} .

If a bad night pushes ρ\rho to 0.995 (μ=0.005\mu = -0.005) with the same noise, the backlog approximation jumps to 0.08/0.01=80.08 / 0.01 = 8 — a four-fold jump from a small shift in utilization, illustrating why near-saturation systems are so sensitive to small load changes.

time queue length reflecting floor at 0
Near saturation the discrete queue length behaves like continuous Brownian motion with a downward drift, repeatedly bouncing off a floor at zero rather than going negative.
|drift| (capacity slack) E[Q] ≈ σ²/(2|μ|)
As available slack (|drift|) shrinks toward zero, mean queue length blows up hyperbolically — the same phenomenon Kingman's formula captures in discrete form.

What this means in practice

Heavy-traffic diffusion approximations let a quant reason about matching-engine backlogs, market-maker inventory near risk limits, or batch-processing pipelines running close to their throughput ceiling, using the same toolkit (drift, volatility, reflecting boundaries) already familiar from modeling asset prices — a genuine two-way bridge between queueing and stochastic-process modeling. They're most valuable exactly where exact discrete formulas get intractable: multi-server systems, general (non-Poisson) arrivals, or networks of queues.

As utilization approaches 1, a discrete queue's length converges to a continuous reflected Brownian motion — a random walk with a slight drift toward zero, bounced back whenever it would go negative — and its steady-state mean is σ2/(2μ)\sigma^2/(2|\mu|), which explodes as the drift shrinks, mirroring the ρ/(1ρ)\rho/(1-\rho) blow-up from exact queueing formulas.

The diffusion approximation is only valid in heavy traffic — utilization close to 1. Applying it to a lightly loaded queue (say ρ=0.3\rho = 0.3) gives nonsense, because at low utilization the queue spends most of its time empty and the "continuous random walk" picture, which assumes the process is usually away from its zero floor, breaks down entirely. Always check that utilization is genuinely high before reaching for this tool instead of an exact or simulation-based method.

Related concepts

Practice in interviews

Further reading

  • Whitt, Stochastic-Process Limits, ch. 5
ShareTwitterLinkedIn