Skip to content
Tutorials Center
My learning

Topics

Lesson 17 of 38 · Multi-Server Queues

M/M/c Performance Measures

Compute Lq, Wq, W and L for the M/M/c queue from the Erlang C probability, including the tail P(Wq > t), and verify them against a simulation.

Once you know the probability of waiting, C = C(c, a), all the other M/M/c measures follow from short formulas. They resemble the M/M/1 results, with C playing the role that ρ played for a single server.

The formulas

For a stable M/M/c queue (ρ = λ/(cμ) < 1):

Measure Formula
Probability of waiting C = C(c, a)
Mean queue length Lq = C ρ / (1 - ρ)
Mean wait in queue Wq = Lq / λ = C / (cμ - λ)
Mean time in system W = Wq + 1/μ
Mean number in system L = Lq + a

The tail of the waiting time has the same exponential shape as in M/M/1:

P(Wq > t) = C e^(-(cμ - λ) t)

so a customer waits with probability C, and given that they wait, the delay is exponential with rate cμ - λ. The mean delay of those who wait is 1/(cμ - λ).

Check against M/M/1: for c = 1, C = ρ, so Lq = ρ²/(1-ρ) and Wq = ρ/(μ - λ). These are exactly the formulas from the previous chapter.

A calculator

The function builds all measures from λ, μ and c, and verifies Little's law. We use the example of a help desk with λ = 40 calls per hour, μ = 12 per hour per agent and c = 4 agents (a = 3.33, ρ = 0.83).

Python M/M/c calculator

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Checking with a simulation

To simulate c servers, keep a list of the times at which each server becomes free. Each arriving customer takes the server that frees up first. The waiting time is the gap between the customer's arrival and the time that server is free (zero if a server is already idle). A heap makes that efficient.

Python Simulate M/M/c

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The simulated and theoretical numbers agree within sampling noise, which confirms the formulas, including the exponential tail.

Reading the numbers

For the help desk above, ρ is about 0.83, yet a large share of callers wait, and the mean wait in the queue is a few minutes. Adding a single agent would drop both quickly, as the staffing lesson shows. The formula Wq = C/(cμ - λ) also warns you: the denominator cμ - λ is the spare capacity of the whole system. When spare capacity is small, waiting is long.

Check your understanding

Quick check · 4 questions

of 4 answered You scored / 4 · perfect!

  1. 1. In M/M/c, which formula gives the mean time spent waiting in the queue?

    Wq = C / (c mu - lambda), where C is the Erlang C probability.
  2. 2. Given Lq, how do you find Wq?

    Little's law applied to the line: Lq = lambda * Wq.
  3. 3. With c = 5, mu = 2 and lambda = 8 (per minute), what is c*mu - lambda?

    5 * 2 - 8 = 2 per minute of spare capacity.
  4. 4. Given that a customer waits, how is the delay distributed?

    P(Wq > t) = C exp(-(c mu - lambda) t), so the conditional delay is exponential with that rate.

Summary

  • Lq = Cρ/(1-ρ), Wq = C/(cμ-λ), W = Wq + 1/μ, L = Lq + a.
  • P(Wq > t) = C e^(-(cμ-λ)t).
  • With c = 1 they reduce to M/M/1.
  • A heap-based simulation matches the formulas.

Next: One Line or Many?