MathsAdvanced Equations

Queuing Theory
calculator.

See how long a line waits, how busy the servers are, and how many you need.

How it's worked out

The models here are written M/M/c. The first M means customers arrive at random at a steady average rate, the second M means service times are random too, and c is the number of servers (Ross, Eastern Michigan University). Four letters, as in M/M/1/6, add a limit on how many fit in the system.

You give λ, the arrivals per unit of time, and μ, how many one server finishes in that time. Their ratio is the offered load a, in erlangs: how many servers the work keeps busy on average. Divide by c for the utilization ρ.

a\displaystyle a=λμ\displaystyle {}= \frac{\lambda}{\mu}
ρ\displaystyle \rho=ac\displaystyle {}= \frac{a}{c}

With no limit on room, ρ must be below 1, or the line grows without end. The Erlang C formula then gives C, the chance an arrival finds every server busy. From it come the average number waiting and the average wait.

Lq\displaystyle L_q=Cρ1−ρ\displaystyle {}= \frac{C \rho}{1 - \rho}
Wq\displaystyle W_q=Lqλ\displaystyle {}= \frac{L_q}{\lambda}
W\displaystyle W=Wq+1μ\displaystyle {}= W_q + \frac{1}{\mu}

Little's law ties the averages together: the number in the system is the arrival rate times the time each one stays, and the same holds for the line alone. The working ends with that check. With a limit K, the tool works out the chance of each count from 0 to K, and arrivals that find it full are lost.

L\displaystyle L=λW\displaystyle {}= \lambda W

Worked examples

Dana staffs a call center for the lunch hour

Dana expects 50 calls an hour, and a call takes 5 minutes, so one agent handles 12 an hour. The offered load is 4.17 erlangs. With 5 agents, each is busy 83.3% of the time.

Erlang C says 62% of callers wait at all. The average wait is 3.7 min, and 62.4% are answered within 3 minutes.

Her goal is 80% within 3 minutes. Solving for servers gives 6 agents, which answer 89.1% in time with an average wait of 0.9 min. A 7th agent would cut that to 0.3 min.

Open this example in the tool

One checkout, then two in one line

A shop gets 8 customers an hour, and its one till serves 10 an hour. The till is busy 80% of the time, yet the average wait is 24 min, with 3.2 people in line. Only 34.5% start within 6 minutes.

Now picture two such shops side by side, each with its own line. Merge them into one line feeding both tills, with 16 customers an hour, and the wait drops to 10.7 min. The staff is the same. The gain comes from no till sitting idle while the other has a line.

Open this example in the tool

A car wash with room for 6 cars

Cars arrive 6 an hour and the bay washes 5 an hour, so it could never keep up without a limit. With room for 6 cars, washing and waiting, the line stays finite. But 23.1% of drivers find it full and leave.

The bay is busy 92.3% of the time. A driver who gets in spends 48.3 min there on average. Room for 10 cars cuts the lost drivers to 19.3%, but stretches that time to 83.1 min.

Open this example in the tool

Reading your result

Average wait in line. This is the time before service starts. For people, this is the number that matters, because once they are served they are content.

Utilization. A high share keeps costs down, and a low one keeps waits down. One server shows how sharply the trade bends near full:

One server that finishes 10 an hour
BusyIn lineWait
50%0.56 min
80%3.224 min
90%8.154 min
95%18.1114 min

Served within t. Call centers set goals like 80% within 20 seconds. The share comes from Erlang C and the spare capacity cμ − λ. No steady state. At 13 arrivals an hour against one server finishing 12, the utilization is 108.3% and the tool gives no average, because the line keeps growing.

Common mistakes

  • Mixing time units. If calls come per hour, the service rate must be per hour too. A 5 minute call is 12 an hour, not 5.
  • Using the average call length as μ. μ is a rate, the number one server can finish in the time unit, so it is 1 over the average service time.
  • Staffing to 100% busy. At full use the line never settles. Real teams also need time for breaks, so plan above the count shown.
  • Using one busy hour for a whole day. The models assume a steady arrival rate. Work out each hour on its own when the rate changes through the day.

Questions people ask

The wait in line, Wq, stops when service starts. The time in the system, W, adds the service itself, so W is Wq plus one average service time. Customers feel the first, and a factory counting work in progress cares about the second.

Sources