← Research

Research Note

Queueing Theory for Quants: Workload, Bursts and Waiting-Time Risk

Open in an AI assistant with a suggested prompt
Preview prompt
Summarize the Ionitsa research note titled "Queueing Theory for Quants: Workload, Bursts and Waiting-Time Risk" for a technical reader.
Cover the problem or research question, implementation or method, evidence or results, and limitations.
Separate facts stated on the page from your own assessment, note anything unclear or unverified, and avoid promotional language.

Primary source: https://ionitsa.com/research/renewal-queues-workload.md
Canonical page: https://ionitsa.com/research/renewal-queues-workload/

An interactive guide to single-server queues, workload processes and renewal arrivals, with a quant-focused explanation of capacity, burstiness, tail latency and model validation.

Systems · Published 3 August 2026 · Updated 3 August 2026 · 9 min read

Queueing TheoryStochastic ProcessesMarket MicrostructureRenewal ProcessesMonte Carlo
Queueing Theory for Quants: Workload, Bursts and Waiting-Time Risk

Queueing theory is the mathematics of what happens when random demand meets finite capacity. The visible output may be a line of customers, an order waiting for execution, a risk job waiting for compute or a payment waiting for liquidity. The underlying problem is the same: work arrives unevenly, capacity removes it, and any temporary imbalance becomes delay.

For a quant, the interesting object is not simply the average number of arrivals. It is the distribution of unfinished work and waiting time. Two systems can process the same average volume and have completely different tail latency because one receives smooth flow and the other receives bursts.

This note builds that intuition from the smallest useful model: one server, deterministic unit service and renewal arrivals. It explains the mechanics, derives the simulation, checks the Poisson case against a closed-form benchmark and shows what changes when the arrival clock is more or less variable.

Scope. This is a model laboratory, not a literal model of an exchange or a production trading stack. The assumptions are one first-come-first-served server, independent interarrival times, deterministic unit service, no cancellations and an infinite waiting room.

Why a quant should care

Queues appear throughout financial markets:

The analogy is not cosmetic. Limit-order-book models explicitly represent the best bid and ask as interacting queues and use order arrival, cancellation and execution intensities to study the next price move. Cont and de Larrard (2013) are a useful bridge between classical queueing and market microstructure. Payment systems also use queueing and netting mechanisms when available liquidity is scarce. BIS Project Titus is a recent institutional example.

The practical lesson is broader:

Average capacity can look comfortable while tail delay is already dangerous.

A desk that monitors only average messages per second, average tickets per analyst or average collateral movements per hour is missing the stochastic part of the risk. Capacity tells us whether the system can survive on average. The arrival distribution tells us how painful the path can be.

The right state variable is workload

A queue can be described by the number of jobs present, but workload is often the cleaner state. Let V(t)V(t) be the amount of unfinished service at time tt. If every job requires exactly bb units of service and the server processes one unit of work per unit of time, then:

The result is a saw-tooth path. In reflected-process notation,

V(t)=V(0)+bN(t)t+L(t),V(t)=V(0)+bN(t)-t+L(t),

where N(t)N(t) counts arrivals and the non-decreasing regulator L(t)L(t) prevents workload from becoming negative.

This change of state is a quant move: choose the variable that preserves the economics while simplifying the dynamics. A count treats every item as equal. Workload measures the time or capacity required to clear what is actually there. In trading terms, ten small messages and ten expensive risk calculations have the same count but very different operational exposure.

With deterministic unit jobs, the distinction is especially transparent. Waiting time equals the workload seen on arrival, and the number of customers in the system is V(t)/b\lceil V(t)/b\rceil away from event boundaries.

Lindley’s recursion: the simulation engine

The continuous path is intuitive, but the easiest exact simulation observes the system only at arrival times. Let:

Then

Wn+1=max{0,Wn+bAn+1}.W_{n+1}=\max\{0,W_n+b-A_{n+1}\}.

This is Lindley’s recursion. The logic is mechanical:

  1. take the backlog seen by the previous customer;
  2. add that customer’s service requirement;
  3. subtract the work completed before the next arrival;
  4. reflect at zero because an idle server cannot create negative backlog.

In pseudocode:

wait = 0 for each interarrival gap: wait = max(0, wait + service_time - gap) record(wait)

That small recurrence is the pathwise ground truth for a GI/G/1 queue. It is fast enough to generate millions of observations and simple enough to use as a test oracle for a more elaborate density solver. The construction goes back to Lindley (1952).

Utilisation is a nonlinear risk factor

Let λ=1/E[A]\lambda=1/\mathbb{E}[A] be the mean arrival rate. Traffic intensity is

ρ=λb.\rho=\lambda b.

For an infinite-buffer single-server queue, the usual stability condition is ρ<1\rho<1. Below one, the server has spare capacity on average. At or above one, backlog has no stationary distribution except in special degenerate cases.

The subtle point is that “below one” does not mean “safe”. For Poisson arrivals and deterministic service, the Pollaczek-Khinchine formula gives

E[Wq]=λb22(1ρ).\mathbb{E}[W_q]=\frac{\lambda b^2}{2(1-\rho)}.

With b=1b=1, the convexity is easy to see:

Utilisation ρ\rhoMean queue wait
0.500.50
0.751.50
0.904.50
0.959.50

The last five percentage points of capacity are not equivalent to the first five. As ρ\rho approaches one, a small forecasting error or temporary burst can create a disproportionately large delay. This is the queueing analogue of convex risk: the exposure is manageable until the system moves close to a boundary, then sensitivity rises sharply.

Burstiness is a separate source of risk

Mean arrival rate is only the first moment of the flow. The experiment compares four interarrival clocks with the same λ\lambda:

ClockInterarrival constructionSquared coefficient of variation
DeterministicA=1/λA=1/\lambda00
Erlang-2two exponential phases, each with rate 2λ2\lambda0.50.5
Poissonexponential with rate λ\lambda11
Bursty lognormallognormal with σ=1.15\sigma=1.15, rescaled to mean 1/λ1/\lambdaabout 2.752.75

At ρ=0.75\rho=0.75 and unit service, perfectly regular arrivals never wait: every job reaches a server that has already cleared the previous job. Poisson arrivals have the same average volume but a theoretical mean queue wait of 1.5 time units. A high-variance clock creates longer clusters and a heavier tail.

That comparison is the central quant insight. Utilisation and burstiness are different risk factors. A capacity forecast based on average flow can be correct and the latency forecast can still be badly wrong.

The squared coefficient of variation,

ca2=Var(A)E[A]2,c_a^2=\frac{\operatorname{Var}(A)}{\mathbb{E}[A]^2},

is a useful first diagnostic. It is dimensionless, so flows with different time scales can be compared. It does not describe serial dependence or extreme-tail shape, but it immediately distinguishes scheduled flow from memoryless flow and bursty flow.

Two views of the same system

Pathwise view

Lindley’s recursion follows individual arrivals. It is the natural choice for Monte Carlo, stress scenarios and empirical waiting-time quantiles. It makes few numerical assumptions and exposes every sample path.

Distributional view

Sometimes we want the probability distribution over all possible workload states rather than a collection of paths. With exponential interarrivals, arrivals form a Poisson process and workload alone is Markov. For positive workload, its density can be represented schematically as

p(v,t)t=p(v,t)v+λ[p(vb,t)1vbp(v,t)],\frac{\partial p(v,t)}{\partial t} =\frac{\partial p(v,t)}{\partial v} +\lambda\left[p(v-b,t)\mathbf{1}_{v\ge b}-p(v,t)\right],

with separate treatment of probability mass at the empty boundary.

The derivative transports probability towards zero as the server works. The jump term removes probability from the current workload and adds it one service requirement higher when an arrival occurs. Numerically, this becomes a combination of a downward shift and a sparse upward-jump operator.

The two views should agree. A density method that cannot reproduce pathwise Monte Carlo and the M/D/1 benchmark has failed, however elegant its derivation looks.

What changes with non-Poisson arrivals

Exponential waiting times are memoryless. If an event has not occurred yet, the remaining time has the same distribution as it had at the start. A general renewal clock does not have that property. The probability of the next arrival depends on the age of the current interarrival interval.

Workload by itself is therefore no longer a Markov state. There are two standard ways forward:

  1. Augment the state. Track workload and the age of the arrival clock. The pair is Markov and can be evolved using an age-structured transport equation.
  2. Retain history. Eliminate the age variable and express the arrival effect as a convolution against a memory kernel.

If ff is the interarrival density and f^(s)\widehat f(s) its Laplace transform, the renewal kernel satisfies

K^(s)=sf^(s)1f^(s).\widehat K(s)=\frac{s\widehat f(s)}{1-\widehat f(s)}.

Hoffmann, Porter and Lambiotte (2012) developed this generalized master-equation construction for non-Poisson walks. Lai and de Kamps (2017) combined a memory kernel with characteristic-aligned bins that separate deterministic motion from random jumps.

“General” still has boundaries. A renewal process assumes independent interarrival times from one clock. Intraday seasonality, clustered order flow, self-excitation and state-dependent cancellation require richer models.

How the interactive experiment is built

The browser experiment uses the pathwise formulation, not an opaque numerical solver.

  1. Normalise service. Every job requires one time unit, so b=1b=1.
  2. Choose load. The traffic-intensity control sets ρ\rho. Because b=1b=1, this is also the mean arrival rate λ\lambda.
  3. Generate arrivals. Each clock samples interarrival gaps with mean 1/λ1/\lambda, holding average demand constant.
  4. Draw a workload path. Over 48 time units, workload falls at unit speed and jumps by one at each arrival.
  5. Estimate waiting-time risk. Lindley’s recursion runs for a 1,000-arrival warm-up and retains the next 7,000 waits.
  6. Validate. When Poisson arrivals are selected, the empirical mean is compared with the M/D/1 formula.

The upper chart shows one realised path. The lower chart compares empirical cumulative waiting-time distributions for all four clocks at the chosen load.

Interactive experiment

One server, four arrival clocks

Hold mean load constant and change only the regularity of arrivals. The upper chart is one realised workload path; the lower chart compares empirical waiting-time distributions.

Mean wait
Customers delayed
Peak workload
Workload path Each jump is one arrival; diagonal segments are deterministic service.
Waiting-time distribution at equal mean load Curves further right imply longer waits and a heavier congestion tail.

How to read the output like a quant

OutputWhat it measuresQuant interpretation
Mean waitaverage latency costuseful, but hides the tail
Customers delayedprobability W>0W>0frequency of capacity contention
Peak workloadworst backlog on one pathstress indicator, not a stable estimate
Waiting-time CDFfull empirical distributionsource of median, p95 and p99 latency
Gap between clockseffect of flow shape at fixed meanburstiness premium

Do not read one random path as a forecast. The path explains mechanism; the distribution supports inference. In production research, the next step would be confidence intervals, repeated seeds, longer warm-up tests and explicit estimation error.

Four lessons from a hedge-fund quant perspective

State compression is part of the edge

The best model is often not the one with the most variables. It is the one whose state retains the risk that matters. Workload compresses an entire queue into the time required to clear it. In another setting the correct state may be queue imbalance, inventory, outstanding notional or remaining risk limit.

Averages are not distributions

Average order flow, average compute use and average operational throughput are budget numbers. Trading and risk decisions are usually made in the tails. Capacity planning should therefore pair ρ\rho with variance, serial dependence and high quantiles of waiting time.

Model assumptions behave like positions

Assuming Poisson arrivals is not a harmless default. It is a position on the shape and dependence of order flow. Assuming deterministic service is a position on job-size risk. A quant should know which result is driven by data and which is driven by the model’s convenience.

Validation needs an independent route

Monte Carlo, a density equation and a closed-form benchmark fail in different ways. Agreement between them is much stronger evidence than making one method more complicated. This is the same discipline used when independently rebuilding a pricing result or checking a production risk number.

From the toy queue to a market model

This G/D/1 laboratory is deliberately narrow. Extending it changes the economic question:

The point of the simple model is not realism by omission. It is identification: first isolate utilisation and interarrival variability, then add market mechanisms one at a time.

Personal reference and source artifact

This page grew from a student project and the QueueingTheory repository. The original poster is preserved below as a personal reference and a record of the initial route from population-density methods to queueing. Its historical title, A novel algorithm for G/D/1 queues, should not be read as a current novelty or validation claim.

Original research poster titled A novel algorithm for G/D/1 queues
Original University of Nottingham student-project poster. Institutional branding is retained as part of the source artifact and does not imply current endorsement. Select the image to open the full-resolution PDF.

Open the original poster as a PDF

The current page does not reuse the poster’s unfinished renewal solver. It rebuilds the pathwise queue from Lindley’s recursion, makes every distributional assumption visible and benchmarks the Poisson case against established theory. That is the distinction between preserving an idea and relying on an old numerical result.

AI-assisted research reconstruction

Modern coding models make this kind of personal research archaeology much less expensive. They can trace legacy code, recover assumptions, translate obsolete syntax, generate tests and help compare an implementation with known results. A 2025 Wiley survey reported that 84% of surveyed researchers had used AI tools in their work and 62% had used them for research or publication tasks. Wiley, ExplanAItions 2025

AI was used here as a research and implementation assistant, not as an authority that could declare the mathematics correct. The standard remains reproducible code, explicit assumptions and independent checks. The useful workflow is not “ask a model whether this is right”; it is “use a model to make the work cheap enough to rerun, inspect and try to falsify.”

Conclusion

Queueing theory gives quants a compact language for capacity risk. Workload is the state, ρ\rho measures average pressure, the arrival distribution controls burstiness, and the waiting-time distribution records the cost.

The deepest lesson is that equal average flow does not imply equal risk. A smooth stream, a Poisson stream and a clustered stream can consume the same capacity while producing radically different delay profiles. That principle travels well—from order books and execution systems to compute, operations, payments and collateral.

Sources