M/D/1 and M/G/1 Lab

Computer Systems Modelling · Interactive lab

Single-server queues: M/D/1 and M/G/1

Arrivals are Poisson with rate λ = 1 per unit time throughout. Change the service rate and the variability of service times, and watch the simulated queues settle towards the analytic results.

How it works and what to try

How it works: In two tabs. (1) M/D/1 against M/M/1: two animated queues share the same arrivals, one with exponential and one with constant service times. Their running mean delays are plotted against theory as you vary the service rate μ. (2) M/G/1 and the P-K formula: a second slider sets the squared coefficient of variation CS² of service time, from 0 (constant) to 4 (highly variable), using gamma-distributed service. The page works through the formula at the current settings and plots mean delay against both μ and CS². Either tab can show time in queue or time in system.

Try this: On the first tab, check that the M/D/1 queueing delay is exactly half the M/M/1 delay at every μ. On the second, snap between CS² = 0 and 1 to recover both cases, then push CS² to 4 and see how much longer the simulated mean takes to settle when rare, very long services dominate.

1.50
1.05 (ρ ≈ 0.95)3.00 (ρ ≈ 0.33)
λ (fixed)
1.000
ρ = λ/μ
—
𝔼(S) = 1/μ
—
Measure shown in the simulations and charts

Expected time in queue

M/M/1𝔼(Wq) = 1μ(ρ(1 − ρ))
M/D/1𝔼(Wq) = 1μ(ρ2(1 − ρ))

Time in system adds one mean service time: 𝔼(T) = 𝔼(Wq) + 1/μ.

Theory at this μ

M/M/1 —
M/D/1 —
Ratio M/D/1 ÷ M/M/1—
M/M/1exponential service times, mean 1/μ
Simulated
—
Theory
—
Served
0
In system
0
M/D/1every service takes exactly 1/μ
Simulated
—
Theory
—
Served
0
In system
0
t = 0
Mean time in queue as the service rate varies
M/M/1 theory M/D/1 theory Simulated mean so far

What to notice

At every service rate, the M/D/1 queueing delay is exactly half the M/M/1 delay: removing the variability of service times halves the mean wait, although the server is just as busy. Both curves blow up as μ approaches λ. Near ρ = 1 the simulated means converge slowly and fluctuate a lot, so run 10,000 more arrivals a few times before trusting them.