SimuVeda/ Operations

Operations · Simulator 071

Queueing Systems

Customers arrive at random and wait for a free server. Change how fast they arrive, how fast they are served, and how many servers there are. Watch the queue grow and shrink, and see why waiting times explode as servers approach 100% busy.

CollegeCollege operations research

Experiments 0 of 0 Challenge not tried

How the model works

This is an M/M/c queue: Poisson arrivals at rate λ, exponential service at rate μ per server, and c servers. The utilisation is ρ = λ / (cμ), which must stay below 1 or the queue grows without limit.

For one server (M/M/1):

L = ρ / (1 − ρ) (average number in system)
W = 1 / (μ − λ) (average time in system)
Little's law: L = λ W

Waiting time grows like 1/(1 − ρ): going from 80% to 90% busy doubles the average time in system, and 95% doubles it again. The simulator runs a discrete-event simulation with a seeded generator and compares measured averages with the Erlang C formula for c servers.

First-come first-served, infinite waiting room, no balking or reneging. Averages need long runs to settle, especially at high utilisation.

Guided experiments

  1. 80% busy. λ = 4/min, μ = 5/min, one server. Prediction: L ≈ 4 customers in the system and W ≈ 1 minute.
  2. 95% busy. λ = 4.75/min. Prediction: W rises to 4 minutes, and the queue swings wildly.
  3. Pool the servers. Two servers sharing one queue vs one server twice as fast. Prediction: at λ = 8, two servers at μ = 5 give W ≈ 0.56 min, while one server at μ = 10 gives W = 0.5 min. Pooling is close, and both beat two separate queues.

Challenge

A help desk receives 30 calls per hour, and each takes 6 minutes on average. With one agent, what is the average time a caller spends in the system? With two?

Reveal the explanation

λ = 0.5/min and μ = 1/6 per min, so one agent has ρ = 3, which is impossible: the queue grows for ever. Two agents also give ρ = 1.5, still unstable. You need at least 4 agents (ρ = 0.75). Try λ = 0.5, μ = 0.1667 with c = 4.

References

  • Kleinrock, Queueing Systems, Volume 1: Theory (1975), ch. 3.
  • Little, J. D. C. (1961), “A proof for the queuing formula L = λW”, Operations Research 9: 383–387.

Related simulators

Worked example

One server: λ = 3 customers per minute, μ = 4 per minute, so ρ = 0.75.

M/M/1 results: L = ρ / (1 − ρ) = 3 in the system, W = 1 / (μ − λ) = 1 minute, of which 0.75 min is queueing. Little's law checks: L = λW = 3 × 1.

Add 20% traffic (λ = 3.6, ρ = 0.9): W = 1 / 0.4 = 2.5 minutes. A small rise in load more than doubles the wait.

Two servers at the same utilisation (λ = 6, μ = 4, c = 2): with a = λ/μ = 1.5, P₀ = 1 / (1 + 1.5 + 1.5² / (2 × 0.25)) = 1/7, Lq = P₀ × 1.5² × 0.75 / (2 × 0.25²) ≈ 1.93, so Wq = 1.93 / 6 ≈ 0.32 min, less than half the single-server queueing time.

Set λ = 3, μ = 4, c = 1; then λ = 3.6; then λ = 6 with c = 2.

Common questions

What is Little's law?

L = λW: the average number in a system equals the arrival rate times the average time each one spends there. It holds for almost any queue, whatever the arrival or service pattern.

Why do waiting times explode near full utilisation?

Random bursts of arrivals build a queue that the server can only work off when it has spare capacity. As ρ approaches 1 there is almost no spare capacity, so the wait grows like 1 / (1 − ρ).

What does M/M/c mean?

Arrivals are random (Markov, so Poisson), service times are random (exponential), and there are c servers sharing one queue.

Keyboard shortcuts

Space
Play or pause
S
Step
R
Reset
F
Full screen
?
Show this list