Erlang C vs simulation: when the formula is right and when it is not

Erlang C is exact for its own assumptions: random arrivals and exponential service times. When service times are more spread out than that, real waits are longer; when they are more regular, shorter. With three servers at 80% busy, average wait runs from 0.66 to 2.04 minutes just by changing the shape of service time.

Erlang C formula1.29 min64.7% of customers wait
Long-tailed service (simulated)2.04 min57% above the formula
Constant service (simulated)0.66 min49% below the formula

What Erlang C assumes

  • Customers arrive at random, with a constant average rate (Poisson arrivals).
  • Each service time is exponential: a very wide spread, with a standard deviation equal to the mean and a long right tail.
  • c identical servers share one line, and the line has no limit.
  • Nobody gives up and nobody is prioritised.

Inside those assumptions the formula is exact, so this guide does not say Erlang C is wrong. It asks what happens to the answer when only one assumption changes: the shape of the service time.

The experiment

Three servers, two arrivals a minute at random, and a mean service time of 1.2 minutes, so the servers are 80% busy. We change only the distribution of the 1.2 minutes. Each run is 30 replications of 200 hours with a 10-hour warm-up, seed 7, in the Simflowly engine.

Results

Average wait for four service-time shapes against the Erlang C formula
Service timeAverage wait (95% interval)95th percentileErlang C × (1 + cs²) ÷ 2Open
Erlang C formula1.29 minn/a1.29 minformula
Exponential (the Erlang C assumption)1.30 min (1.25 to 1.35)5.11 min1.29 minOpen model
Lognormal, sd 1.5 x mean (long tail)2.04 min (1.93 to 2.14)8.80 min2.10 minOpen model
Normal, sd 0.3 x mean0.73 min (0.71 to 0.74)2.74 min0.71 minOpen model
Constant0.66 min (0.64 to 0.68)2.48 min0.65 minOpen model

Utilization came out at 80% in every case. Exponential simulation lands on the formula (1.30 vs 1.29 minutes, as it should: the assumptions match). Waits are averages before service starts; 8.8 min is the 95th percentile for the long-tailed case, so one customer in twenty waits that long or more.

Rerun it here

Runs the four models in your browser: seed 7, 30 replications of 200 hours each. It takes a few seconds and should match the table above.

The model, as JSON (lognormal case)
{
  "nodes": [
    {
      "id": "src",
      "kind": "source",
      "name": "Arrivals",
      "x": 60,
      "y": 120,
      "interarrival": {
        "type": "exponential",
        "mean": 0.5
      }
    },
    {
      "id": "st",
      "kind": "station",
      "name": "Servers",
      "x": 260,
      "y": 120,
      "servers": 3,
      "cycle": {
        "type": "lognormal",
        "mean": 1.2,
        "sd": 1.7999999999999998
      }
    },
    {
      "id": "out",
      "kind": "sink",
      "name": "Done",
      "x": 460,
      "y": 120
    }
  ],
  "edges": [
    {
      "id": "e1",
      "from": "src",
      "to": "st"
    },
    {
      "id": "e2",
      "from": "st",
      "to": "out"
    }
  ],
  "settings": {
    "horizon": 12000,
    "warmup": 600,
    "replications": 30,
    "seed": 7
  }
}

For the other three, replace the station's cycle with { "type": "exponential", "mean": 1.2 }, { "type": "normal", "mean": 1.2, "sd": 0.36 } or { "type": "constant", "value": 1.2 }. Times are in minutes. The "Open model" links build exactly these models in Simflowly (free account needed to save them); the Free plan fits them, since each has one station.

Why: the variability term

Kingman's approximation says waiting time is proportional to (ca² + cs²) ÷ 2, where ca and cs are the coefficients of variation of the arrivals and the service time. Arrivals are random here (ca = 1). Service cv is 1 for the exponential, 1.5 for the long-tailed lognormal, 0.3 for the normal case and 0 for the constant. Relative to the exponential case, the multiplier is (1 + cs²) ÷ 2 : 1.63, 0.55 and 0.5, which is what the last column applies to the Erlang C figure. It is an approximation, but it explains the ordering. The wait vs utilization calculator lets you vary all of it and checks it against a simulation, including where Kingman is off.

The practical consequence: two sites with the same arrivals, the same staff and the same 80% utilization can see average waits that differ by a factor of three, because their service times are shaped differently.

What simulation still cannot fix

Simulation shows what the formula hides when the assumptions change, but it only answers the model you build. Simflowly does not model customers who abandon the line, priority or acuity classes, skills-based routing, multi-class customers or staffing that changes hour by hour. If those drive your system, a simulation of this kind will not capture them any better than Erlang C does, and the result needs a different model.

Rule of thumb for choosing

  • Service times roughly exponential, a quick first number: Erlang C. Use the queue calculator.
  • Service times standardised or scheduled (cv well under 1): expect shorter waits than the formula; simulate or scale by (1 + cs²) ÷ 2.
  • Long-tailed service (cv above 1), or a decision where the 95th percentile matters: simulate.
  • Stages, splits, limited queues, shared crews, breaks or failures: simulate.

Questions

Does Erlang C underestimate waits?

Only when service times are more variable than exponential. Erlang C assumes exponential service, which has a coefficient of variation of 1. If your service times have a long tail (cv above 1) the true wait is longer; if they are more regular (cv below 1) the true wait is shorter, so Erlang C overestimates. In the experiment, the long-tailed case is above the formula and the regular cases are below it.

What is Erlang A, and does Simflowly model it?

Erlang A adds customers who give up while waiting. Simflowly does not model abandonment, balking or reneging: the only loss it counts is arrivals that find a full queue when you set a queue capacity.

Can I just multiply by a variability factor?

You can, as an approximation. Multiplying the Erlang C wait by (1 + cs²) ÷ 2, where cs is the coefficient of variation of service time, is a standard heavy-traffic style correction. In the table it lands within a few percent of the simulation at 80% busy with random arrivals. It is an approximation, and it gets less reliable at low utilization and with regular arrivals.

How many replications are enough?

Enough that the 95% interval is narrower than the decision you are making. Here 30 replications of 200 hours give an interval of roughly ±0.05 minutes on the average wait. Percentiles need more data than averages.

When should I stop using Erlang C?

When service times are clearly not exponential and the decision is sensitive to the wait, when arrivals are scheduled or come in waves, or when the system has stages, splits or limited queues. For a quick first estimate with unstructured service, Erlang C is fine.

Keep going