Queueing Theory Simulator (M/M/1)

arrival/service rates and queue stability

Loading interactive simulation...

the rho cliff 🖖

L = ρ/(1−ρ) doesn't grow smoothly — it has a vertical asymptote at ρ = 1, so as utilization creeps from 90% to 99% the average number in the system jumps from 9 people to 99, and right at capacity it's unbounded. That's the 'rho cliff': a queue at 80% utilization feels almost identical to one at 85%, but push it to 95% and wait times balloon, because W = 1/(μ−λ) has the same singularity — the denominator is shrinking toward zero, not the numerator growing. It's why real systems like call centers and hospital ERs are deliberately overprovisioned well below 100% capacity: that 'wasted' idle headroom near the top is what keeps you off the cliff.

randomness is what builds the line 🖖

In M/M/1 the two M's stand for "Markovian": arrivals come at random (Poisson) and service times vary at random (exponential), through a single server. The core idea is surprising — a queue can build even when the server is on average faster than customers arrive. If everyone showed up like clockwork and every job took the same time, a server with spare capacity would never form a line. Waiting comes from variability, not from overload. Set λ well below μ and a line still flickers in and out. Set both patterns to clockwork and the trace above never leaves 0 and 1: with identical gaps and identical jobs the server has always finished before the next arrival, at every utilisation below 1.

Little's Law asks for almost nothing 🖖

The L and W shown here are not independent: they satisfy L = λW, and likewise Lq = λWq. That identity assumes almost nothing. John Little proved it in 1961, and what it needs is only this: a long-run arrival rate that exists and is finite, and a long-run mean time in system that does too. Not Poisson arrivals, not exponential service, not independence, not one server, not even a distributional steady state. You can watch what that is worth in the table above. Put a clockwork or a bursty pattern into either stream and ρ/(1−ρ) comes out four times too high at one setting and fifteen times too low at another, while λW and the independently counted L stay within 0.011 of a customer at every one of the 405 settings swept. The same relation governs a hospital ward, a factory's work-in-progress and a store's inventory: average contents equal arrival rate times average time spent inside.

two averages, and only one of them belongs to a customer 🖖

Set both patterns to clockwork and read two rows of the table against each other. The queue an arriving customer finds is 0.000. The observer counting the same queue over time gets 0.751. Every customer walks into an empty system. The server is busy three-quarters of the time. Both are correct, because L weights queue length by time while the arrival's view weights it by customer, and nothing makes two different weightings agree. Little's law pairs a time average with a customer average and never claims that they do. With Poisson arrivals they coincide, which is why the distinction is easy to miss: an arrival is equally likely at any instant, so a customer's view is a fair sample of the clock. That is the PASTA property, and it belongs to the arrivals rather than to the queue. Switch arrivals to bursty and the same run gives 27.011 against a clock average of 21.482, because a burst is both when most customers arrive and when the line is longest.

Problems solved in full

  1. A queue with 3 arrivals an hour and a 20% rise 5 steps

    Customers arrive at 3 an hour and the server handles 4 an hour. The server is idle a quarter of the time, which sounds comfortable. Work out the queue that produces — and then what a 20% rise in arrivals does to it.

    1. The chain balances: the rate into each state equals the rate out, which gives Pₙ = (1 − ρ)ρⁿ — a geometric distribution over queue length, with ρ the fraction of time the server is busy. Here ρ = 0.75.

    2. The mean of that distribution is ρ/(1 − ρ). Look at what is in the denominator: not the spare capacity in customers per hour, but the spare fraction. Three people in the system on average, from a server that is idle a quarter of the day.

    3. Subtract the one being served — present with probability ρ — and 2.25 are left waiting.

    4. Little's law turns a population into a time and needs no distributional assumption at all: the average number in the system is the arrival rate times the average time spent in it. One hour in the system, 45 minutes of it queueing, for a job that takes 15 minutes to do.

    5. Now raise λ to 3.6. Utilisation goes from 0.75 to 0.90 — 20% more work — and ρ/(1 − ρ) goes from 3 to 9.

    Answer

    The tool prints L = 3.000, Lq = 2.250, W = 1.000, Wq = 0.750 at 75% utilisation. The lesson is the denominator of ρ/(1 − ρ): what sets the queue is not how much spare capacity you have but how much you have left as a fraction, and that fraction is what you spend when you add load. Twenty per cent more arrivals triples the number in the system. Another 10% on top — ρ = 0.99 — makes it 99. It is why hospitals, motorways and disk controllers fall over at high utilisation instead of degrading gently, and why "we are only at 90% of capacity" is not the reassurance it sounds like.

  2. The same rates with the randomness taken out 5 steps

    Keep λ = 3 an hour and μ = 4 an hour and take every scrap of randomness out. Arrivals exactly twenty minutes apart, every job exactly fifteen minutes. Utilisation is still 0.750. Work out the queue that produces, and then how far ρ/(1 − ρ) sits from it.

    Open this problem in the tool

    1. Customer k arrives at k/λ and, with the server free, leaves at k/λ + 1/μ. The next one arrives at (k + 1)/λ. The server has finished in time whenever 1/μ ≤ 1/λ, which is ρ ≤ 1 rewritten.

    2. So while the queue is stable nobody waits at all: Wq = 0, and W is the service time alone, 1/μ = 0.250 hours. Fifteen minutes in the building, every minute of it being served.

    3. Little's law turns that into a population and needs no distribution to do it: L = λW = 3 × 0.250 = 0.750, and Lq = 0. Three-quarters of a customer, which is the fraction of time the server is busy and nothing else.

    4. Now ρ/(1 − ρ) = 0.750/0.250 = 3.000, four times the truth. The factor is not a coincidence of these numbers: M/M/1 gives ρ/(1 − ρ) where clockwork gives ρ, so the overstatement is 1/(1 − ρ) at every utilisation.

    5. At ρ = 0.99 that factor is 100. M/M/1 puts 99 people in the system; perfectly regular traffic puts 0.99.

    Answer

    The tool prints W = 0.250, and Little’s law turns that into L = 0.750 against an M/M/1 prediction of 3.000 — an error of +299.6%. The queue was never there. The ρ cliff of the first insight block is built entirely out of variability, and with none left there is no cliff at ρ = 0.99 either. What that buys outside this page is the case for appointments: adding capacity and removing variability both shorten a queue, and 1/(1 − ρ) says the second pays best exactly where the first is hardest to buy. At 75% utilisation a perfectly regular schedule is worth a fourfold cut, at 99% a hundredfold. No real clinic reaches clockwork, and the same rates with clumped arrivals give 21.482 instead.

References (1)
Further reading (1)