Queueing calculator (M/M/1 and M/M/c)

Enter the arrival rate, the mean service time and the number of servers to get the utilization, mean waiting time, mean response time and number waiting from the M/M/1 queueing model (M/M/c when there are several servers). You can check the classic exam formula ρ/(1−ρ) × mean service time, and a chart shows how sharply waiting time rises as utilization goes up.

Inputs

Results

Utilization ρ
–
Service rate μ
–
Probability of waiting
–
Number waiting Lq
–
Number in system L
–
Mean waiting time Wq
–
Mean time in system (response time) W
–

Utilization and waiting time

The results assume random (Poisson) arrivals, exponentially distributed service times, first-come first-served (FIFO) order, an unlimited waiting room and a steady state reached after a long time.

What M/M/1 means: Kendall notation and assumptions

M/M/1 is a queueing model written in Kendall notation, which lists the arrival distribution, the service-time distribution and the number of servers in that order. The first M means arrivals are random (Poisson arrivals, with exponentially distributed gaps between them), the second M means service times are exponentially distributed, and the 1 means there is a single server. M stands for Markov (memoryless): the time until the next arrival or service completion does not depend on how much time has already passed. The model also assumes an unlimited waiting room, first-come first-served (FIFO) order and a steady state in which the averages have settled after a long time. Bank counters, requests to a server, disk I/O and packets waiting to leave a router are all commonly approximated this way.

The formulas and the exam-style procedure

First find the utilization ρ = λ × Ts, where λ is the number of arrivals per unit time, Ts is the mean time to serve one arrival and ρ is the fraction of time the server is busy. Then compute the mean waiting time Wq = ρ/(1 − ρ) × Ts and the mean response time (time in system) W = Wq + Ts = Ts/(1 − ρ). For queue lengths, the number waiting is Lq = ρ²/(1 − ρ) and the number in the system, including the one being served, is L = ρ/(1 − ρ). With the defaults of λ = 0.05 per second (3 per minute) and Ts = 10 seconds, ρ = 0.5, Wq = 0.5/0.5 × 10 = 10 seconds, W = 20 seconds, Lq = 0.5 and L = 1. Exam problems follow the same order: find ρ, multiply Ts by ρ/(1 − ρ) to get the waiting time, and add Ts if the question asks for the response time.

Why waiting time explodes as utilization approaches 100%

Because Wq/Ts = ρ/(1 − ρ), the waiting time equals one service time at 50% utilization, but 4 times at 80%, 9 times at 90% and 19 times at 95%. The denominator 1 − ρ is the fraction of time the server is idle, and as it approaches zero there is no slack left to clear queues that form when arrivals happen to bunch up. That is why the curve on the chart shoots up at the right, and why raising utilization from 80% to 90% more than doubles the waiting time (from 4 to 9 times). Conversely, making service 10% faster at a server running at 90% (Ts = 10 seconds, Wq = 90 seconds) gives Ts = 9 seconds and ρ = 0.81, cutting Wq to about 38 seconds, less than half. CPUs, disks, network links and call centers are therefore designed so that average utilization stays well below 100% and headroom remains at peak times.

Little's law links counts and times

Little's law states that the average number in the system L, the arrival rate λ and the average time each arrival spends in the system W satisfy L = λW, and the same holds for the waiting part alone: Lq = λWq. With the defaults, λ = 0.05 per second and W = 20 seconds, so L = 0.05 × 20 = 1 and Lq = 0.05 × 10 = 0.5, matching the calculator. The difference L − Lq = λ × Ts is the average number being served, which equals the utilization ρ for a single server. The law holds for any stable system regardless of the arrival and service-time distributions, so it remains usable when the M/M/1 assumptions do not. For example, a server that receives 100 requests per second, each taking 0.2 seconds on average, has 20 requests in progress on average.

Multiple servers (M/M/c): one shared queue is faster

With c servers the utilization is ρ = λ × Ts/c, the probability that all servers are busy and an arrival must wait comes from the Erlang C formula, and the mean waiting time is Wq = P(wait) × Ts/(c(1 − ρ)). Doubling the default arrival rate to λ = 0.1 per second and using two servers keeps ρ = 0.5 and gives a probability of waiting of 1/3, Wq ≈ 3.33 seconds and W ≈ 13.3 seconds. If the same arrivals are instead split evenly between two servers with separate queues, each becomes an M/M/1 with λ = 0.05 per second, giving Wq = 10 seconds and W = 20 seconds, so a single line that feeds whichever server is free cuts the waiting time to one third. With separate queues, one server can sit idle while customers wait in line at the other. On the chart, setting c = 2 lowers Wq at 80% utilization to about 1.78 times Ts, compared with 4 times for c = 1. Single-line queues at banks and airports, and server threads that take work from a shared queue, exploit this effect.

Practice performance questions

A server receives 100 requests per second, each taking 0.2 seconds on average (steady state). How many requests are in progress at once on average (Little's law)?

  1. A500
  2. B20
  3. C0.002
Show answer and explanation

Answer: B. 20

Little's law states that the average number in a system L equals the arrival rate λ times the average time each item spends in the system W. With 100 arrivals per second each staying 0.2 seconds, 20 requests are in progress on average. The law helps size thread pools and buffers, and the same reasoning gives how many outstanding requests are needed to saturate memory bandwidth.

What happens to request waiting time as server utilization (fraction of busy time) approaches 100%?

  1. AIt grows sharply (the increase accelerates as utilization rises)
  2. BIt grows gradually in proportion to utilization
  3. CHigher utilization shortens waiting time
Show answer and explanation

Answer: A. It grows sharply (the increase accelerates as utilization rises)

When requests arrive irregularly, queues form whenever arrivals happen to bunch up, even if the server has idle time. The higher the utilization, the less idle time there is to drain queues, so waiting time grows sharply, roughly in proportion to 1 ÷ (1 − ρ) for utilization ρ. Waiting times at 50% and 90% utilization differ several-fold. Systems where responsiveness matters therefore keep utilization headroom.

When evaluating web service response times, why is the 99th percentile (the boundary of the slowest 1%) often examined in addition to the mean?

  1. AThe mean can look good while some requests are very slow, and when a task waits on many components, those slow responses set overall latency
  2. BThe 99th percentile is always smaller than the mean
  3. CThe mean cannot be calculated
Show answer and explanation

Answer: A. The mean can look good while some requests are very slow, and when a task waits on many components, those slow responses set overall latency

Response-time distributions tend to be mostly fast with a small, very slow tail. Looking only at the mean hides that tail. Moreover, when rendering a page waits on 100 components, any one slow response makes the whole slow, so the slowest 1% affects most users. Systems are therefore managed against targets for the slow end (tail latency).

Requests arrive at a service window at an average of 12 per hour, and each takes an average of 4 minutes to handle. Treating it as an M/M/1 queue, which of the following is the utilization of the window?

  1. A0.8
  2. B1.25
  3. C3
Show answer and explanation

Answer: A. 0.8

The utilization ρ is the product of the arrival rate λ and the average service time Ts, and it expresses the fraction of time the window is busy. With matching units, 4 minutes = 1/15 hour, so ρ = 12 × 1/15 = 0.8. Using the service rate μ = 15 per hour, ρ = λ/μ = 12/15 gives the same result.

Requests arrive at a server at an average of 3 per minute, and each takes an average of 15 seconds to process. Treating the server as an M/M/1 queue, which of the following is the average time from the arrival of a request until its processing is finished (the average response time)?

  1. A20 seconds
  2. B45 seconds
  3. C60 seconds
Show answer and explanation

Answer: C. 60 seconds

The utilization is ρ = 3 per minute × 15 seconds ÷ 60 seconds = 0.75. The average waiting time is Wq = ρ/(1 − ρ) × Ts = 0.75/0.25 × 15 = 45 seconds, and adding the processing time of 15 seconds gives an average response time of 45 + 15 = 60 seconds. Ts/(1 − ρ) = 15/0.25 = 60 seconds gives the same result.

For a server that can be treated as an M/M/1 queue, the arrival rate increased with the average service time unchanged, and the utilization rose from 0.8 to 0.9. By what factor did the average waiting time Wq (the time spent waiting in the queue) change? Which of the following is closest?

  1. A1.125 times
  2. B2 times
  3. C2.25 times
Show answer and explanation

Answer: C. 2.25 times

Wq = ρ/(1 − ρ) × Ts, and Ts is unchanged, so the ratio of ρ/(1 − ρ) is needed. At ρ = 0.8 it is 0.8/0.2 = 4, and at ρ = 0.9 it is 0.9/0.1 = 9, so the factor is 9 ÷ 4 = 2.25. As the utilization approaches 1, 1 − ρ approaches 0, so a small increase in utilization makes the waiting time grow sharply.

There are two service windows of the same speed. In scheme A, each customer picks one of the windows with equal probability on arrival and joins that window's own queue. In scheme B, customers join a single queue and are served by whichever window becomes free first. Arrivals are random, and the total arrival rate and service speed are the same in both schemes. Which of the following correctly compares the average waiting time?

  1. AScheme A is shorter, because the queue is split in two and the arrival rate per queue is halved
  2. BScheme B is shorter, because in scheme A one window can be idle while the other has a queue
  3. CThey are the same, because with the same number and speed of windows the average waiting time does not depend on how the queue is formed
Show answer and explanation

Answer: B. Scheme B is shorter, because in scheme A one window can be idle while the other has a queue

Scheme A can be regarded as two M/M/1 queues side by side, each with half the arrival rate. Scheme B is an M/M/2 queue in which two windows share one queue, so a customer is served without waiting whenever either window is free. For example, with an average service time of 1 minute and a total arrival rate of 1 per minute (utilization 0.5), the average waiting time is 0.5/(1 − 0.5) × 1 = 1 minute in scheme A but about 0.33 minutes in scheme B. This is why a single queue shared by several windows is widely used, for example at the counters in banks and in server processing.

A server with an average service time of 0.2 seconds is treated as an M/M/1 queue. To keep the average response time (waiting time plus processing time) at or below 1.0 second, which of the following is closest to the maximum arrival rate that can be accepted?

  1. A4.0 per second
  2. B4.2 per second
  3. C5.0 per second
Show answer and explanation

Answer: A. 4.0 per second

The average response time is W = Ts/(1 − ρ), so 0.2/(1 − ρ) ≤ 1.0 gives 1 − ρ ≥ 0.2, that is, ρ ≤ 0.8. Since ρ = λ × Ts, λ ≤ 0.8 ÷ 0.2 = 4.0 per second. At an arrival rate of 5.0 per second, the utilization would be 1 and the queue would grow without limit.

FAQ

How do I enter an arrival rate given as "30 per hour"?

Use the same time unit for the arrival rate and the mean service time. If 30 arrivals come per hour and the mean service time is 1.5 minutes, set the time unit to minutes and enter λ = 30 ÷ 60 = 0.5 and Ts = 1.5. Then ρ = 0.5 × 1.5 = 0.75, Wq = 0.75/0.25 × 1.5 = 4.5 minutes and W = 6 minutes. If you are given a mean interarrival time of 2 minutes instead, the arrival rate is its reciprocal, λ = 1/2 = 0.5 per minute.

What is the difference between waiting time and response time?

The mean waiting time Wq is the time spent in line from arrival until service starts. The response time (time in system) W adds the service time, covering everything from arrival to completion: W = Wq + Ts. With the defaults, Wq = 10 seconds and W = 20 seconds. Check which one a question asks for, and remember to add Ts for the response time.

What happens when utilization ρ is 1 or more?

On average, work arrives at least as fast as it can be served, so the queue keeps growing without bound and the average waiting time has no finite value. Even at exactly ρ = 1 the queue is not stable as long as arrivals and service times vary randomly. The calculator shows a warning instead of the waiting time. Add servers, speed up service or reduce arrivals so that ρ = λ × Ts/c falls below 1.

What if the M/M/1 assumptions do not hold?

If every service takes exactly the same time, the model is M/D/1 and Wq = ρ/(2(1 − ρ)) × Ts, exactly half the M/M/1 value; with the defaults, Wq drops from 10 seconds to 5 seconds. For general service times (M/G/1), the Pollaczek–Khinchine formula Wq = (1 + Cs²)/2 × ρ/(1 − ρ) × Ts shows that waiting grows with the variability of service times (the coefficient of variation Cs). Bursty arrivals likewise generally make waiting longer than M/M/1 predicts.

Which time unit should I choose?

Any unit works as long as the arrival rate and the mean service time use the same one. If you choose minutes, enter λ per minute and Ts in minutes, and Wq and W are shown in minutes. Utilization, the probability of waiting, Lq and L have no unit, so they do not change with the unit. For example, the default case entered in minutes is λ = 3 and Ts = 1/6 ≈ 0.1667, which gives ρ = 0.5 and Wq ≈ 0.1667 minutes (10 seconds).

Related terms

Little's law Throughput Tail latency Batch size Latency hiding

Related calculators

Semiconductor, Electronics and Computing Calculators →