WAITING LINES / INTERACTIVE LAB

Queueing & Staffing Lab.

Requests show up at random, not on a schedule. So a help desk or inspection crew that’s busy only 80% of the time can still keep people waiting way too long. Set how many requests come in, how long each job takes and how many people are on duty. Then see what share get answered within your target wait, and the fewest staff that reach 90%.

Staffing · the waiting-line formula (Erlang C)

How many inspectors keep waits short?

1–15 inspectors · 2–30 requests/hr · nobody gives up waiting

HEIGHT = % ANSWERED WITHIN 15 MIN

DRAG TO ROTATE · CLICK A CELL

Goal met: 93.6% of requests are answered within 15 min, with inspectors busy 67% of the time. With one fewer, inspectors would still have free time (busy 80% of the time), yet only 73.8% would be answered in time.

Utilization67%share of time inspectors are busy (ρ)
Chance of waiting28%requests that wait at all (Erlang C)
Average wait2.8 minbefore service starts · 1 in 10 waits over 10.5 min
Service level93.6%answered within 15 min · goal 90%
Requests in system4.57on average, waiting or in service · 0.57 waiting
Inspectors needed6fewest for 90% within 15 min

Demand and capacity

Click a spot on the surface, or a column in the service-level chart, to jump there. Changing inspection time or the target wait reshapes the surface. Changing requests per hour or inspectors just moves the marker.

Service level by number of inspectors · 12 requests/hr

ρ ≥ 105090100%07.515m1234567891011121314151 inspector: too few, the line never settles (ρ ≥ 1)2 inspectors: too few, the line never settles (ρ ≥ 1)3 inspectors: too few, the line never settles (ρ ≥ 1)4 inspectors: too few, the line never settles (ρ ≥ 1)5 inspectors: 73.8% within 15 min, average wait 11.1 min6 inspectors: 93.6% within 15 min, average wait 2.8 min7 inspectors: 98.5% within 15 min, average wait 0.9 min8 inspectors: 99.7% within 15 min, average wait 0.3 min9 inspectors: 99.9% within 15 min, average wait 0.1 min10 inspectors: 99.9% within 15 min, average wait 0.0 min11 inspectors: 99.9% within 15 min, average wait 0.0 min12 inspectors: 99.9% within 15 min, average wait 0.0 min13 inspectors: 99.9% within 15 min, average wait 0.0 min14 inspectors: 99.9% within 15 min, average wait 0.0 min15 inspectors: 99.9% within 15 min, average wait 0.0 min

service level (left) average wait, min (right) current crew: 6 fewest for 90%: 6

How long requests wait · 6 inspectors

05090100%01530 minaveragep90target

72% never waitaverage 2.8 minp90: 90% wait ≤ 10.5 min93.6% within 15 min

Erlang C answers

How many people do you need to hit a wait-time target?

Take 12 requests an hour, 20-minute inspections and 6 inspectors. Erlang C gives the chance a request has to wait at all, and how spread out the waits are. A goal like “90% within 15 min” needs that spread, not just the average. Below, a is the workload in erlangs: how many inspectors the work would keep busy full time. ρ is the share of time each inspector is busy.

a = λ/μ = 12 × 20/60 = 4.00 erlangs · ρ = a/c = 66.7%C(c, a) = 0.285 (Erlang B recursion, then C = B / (1 − ρ(1 − B)))P(Wq > t) = C · e^−(cμ−λ)t = 0.285 · e^−(18.00 − 12)·0.250 = 6.4%SL = P(Wq ≤ 15 min) = 93.6%
Little’s Law answers

How do the averages fit together?

Over the long run, the average number of requests waiting equals the arrival rate times the average wait: Lq = λWq. The same goes for the whole system, waiting plus being served: L = λW. Little’s Law can’t pick the crew size by itself. It checks that Erlang C’s averages agree with each other, as long as the units match.

Lq = λ·Wq = 12/hr × 0.0475 hr = 0.57 waitingL = λ·W = 12/hr × 0.381 hr = 4.57 in systemL − Lq = λ/μ = 4.00 inspectors busy on average

The example: mechanics call for inspections, and a crew of quality inspectors works through them from one shared list. The goal is to answer 90% of calls within the target wait. Erlang C makes a few assumptions. Calls arrive at random (a Poisson process), and inspection times vary at random (exponential). Any inspector can take any call, the list has no limit, and nobody gives up waiting.

How the model works, how it’s checked and what it leaves out

How it works

This is an M/M/c queue, shorthand for random arrivals, random service times and c servers. Requests arrive at random at an average of λ per hour (Poisson arrivals). Inspection times are random too (exponential), and they average 1/μ. There are c identical inspectors and one shared first-come, first-served list. The list has no limit, and nobody gives up waiting.

The workload is a = λ/μ, and utilization, the share of time each inspector is busy, is ρ = a/c. The chance of waiting, C(c, a), comes from a step-by-step formula called the Erlang B recursion. It goes B(k) = aB(k−1) / (k + aB(k−1)), then C = B / (1 − ρ(1 − B)). That route skips giant factorials (like 200 × 199 × … × 1), so it stays accurate even with many inspectors.

Service level, the share who wait t or less, is P(Wq ≤ t) = 1 − C·e^−(cμ−λ)t. The averages are Wq = C / (cμ − λ), W = Wq + 1/μ, Lq = λWq and L = λW. When ρ ≥ 1 the line never settles (there’s no steady state). Waits show as ∞, and service level counts as 0. “Inspectors needed” is the smallest c that keeps up and reaches 90% within the target.

The surface shows that service level for every c from 1 to 15 and λ from 2 to 30/hr, at the current inspection time and target. λ is sampled every 0.25/hr. You can’t hire part of an inspector, so the surface steps from one whole number to the next.

How it’s checked

The step-by-step Erlang C matches the textbook factorial formula to about 1e−15 at every slider setting. At c = 200 the factorial version overflows (its numbers get too big for the computer), but the step-by-step one doesn’t. Adding an inspector never lowers the service level, and raising λ never raises it. Any ρ ≥ 1 is flagged as a line that never settles.

Little’s Law is checked against numbers worked out a different way. The M/M/c model gives pₙ, the chance of exactly n requests in the system. Adding up line lengths straight from those, Σ(n − c)pₙ and Σn·pₙ, matches Lq = λWq and L = λW. The average number of busy inspectors, Σmin(n, c)pₙ, equals λ/μ. As λ → 0 the wait goes to 0. The orange line on the surface agrees with the “inspectors needed” search at every whole λ.

What it leaves out

Demand stays the same across shifts, there are no rush jobs, and every inspector can cover every area and task. There’s no travel time, no breaks and no batching of jobs. Inspection times always follow the exponential pattern, and nobody gives up waiting. If any of these matter, switch to an approximate formula such as Allen–Cunneen or Erlang A. Or use a simulation that plays out each request one at a time (discrete-event simulation).

← Network ResilienceAll LabsQueueing Simulation →

The Inner Universe

Still in the works.

I’m still writing this part of the site: a map of the big questions I keep coming back to. Check back soon.