Queue Lab

Queue Lab

Pick how customers arrive and how long service takes, change the rates and the number of service channels, and watch the line, the distributions and the M/M/1 and M/M/s results update together. Time is in minutes.

Kendall notationM/M/3
Stable
Clock 0 min In line 0 Being served 0/3 Served 0 Turned away 0
one color per arrival minute: same-colored people came in the same minute channel busy, bar = service progress “done” tag = service time of the customer who just left turned away (line full)

Arrival rate: arrivals per minute

% of minutes with k arrivalsPoisson(λ) pmf

Service times

% of services per binExponential shape

When a minute ends, its arrival count (the colored box in the strip) flies into the left chart: that chart is the arrival-rate distribution, and for Poisson arrivals it matches the Poisson(λ) dots. Each finished service sends its service time into the right chart. The bright bar is where the newest value landed; the blue marks are what the chosen distribution predicts. Data flies in at speeds up to 8 min/s; faster runs add it directly.

Performance: simulated vs theory

Big number: measured in the simulation since the last setting change. Blue: the formula value. They converge as more customers pass through; press “Run 2,000 customers” to see it.

More distributions

Time between arrivals

% of arrival gaps per binExponential shape

Line length over time

people in linetheory Lqsimulated mean

Number in system, P(n)

share of time with n presentM/M/s theory

Effect of the number of channels: M/M/1 vs M/M/s

“One fast channel” is a single server working s times faster (rate sμ). It has the same total capacity as s channels; comparing it with M/M/s shows the trade-off between pooling and speed.

How the theory numbers are computed

Poisson ⇔ Exponential

If the count of arrivals in a minute is Poisson(λ), the gaps between arrivals are Exponential with mean 1/λ. They describe the same Markovian process (letter M).

P(N=k) = e^(−λ) λ^k / k!    f(t) = λ e^(−λt)
M/M/1

One channel, ρ = λ/μ must be below 1.

L = ρ/(1−ρ) · Lq = ρ²/(1−ρ) · W = 1/(μ−λ) · Wq = ρ/(μ−λ)
M/M/s (Erlang C)

a = λ/μ, ρ = λ/(sμ) < 1.

P₀ = [ Σ_{n=0}^{s−1} aⁿ/n! + aˢ/(s!(1−ρ)) ]⁻¹
P(wait) = aˢ P₀ / (s!(1−ρ)) · Lq = P(wait)·ρ/(1−ρ)
Little’s law

Holds for every queue here. With a limited line, λ is replaced by the rate of people let in, λ(1 − P(turned away)).

L = λW · Lq = λWq · W = Wq + 1/μ
M/M/s/K (limited line)

Solved as a birth–death chain with pₙ ∝ Πλ/(min(k,s)μ) up to s + waiting room. Works for ρ ≥ 1 too.

P(turned away) = p_{s+K}
Normal or constant times (G, D)

No exact formula. The page uses the Allen–Cunneen approximation with squared coefficients of variation c² (Exponential 1, Normal CV², Constant 0).

Wq(G/G/s) ≈ Wq(M/M/s) · (c²ₐ + c²ₛ)/2