A1151 of 55
0 XP
  1. Hook
  2. Play
  3. Predict
  4. Name it
  5. Check
  6. Explain

A11 · Lesson 51 · Queues

Why a router at 90% load is so much slower than at 80%

Packets arrive at a router at random and wait their turn to be sent. Interrupts queue for a processor, print jobs for a printer, calls for an operator. When arrivals are random, a server that is busy less than 100% of the time still builds up queues, and those queues grow explosively as the load approaches 100%. The simplest model, the M/M/1 queue, with Poisson arrivals and random service times, captures this exactly, and Little's law, which holds for almost any queue, ties together how many are waiting and how long they wait.

  • The curve is the mean number in an M/M/1 system, ρ1−ρ, against the utilization ρ, the fraction of time the server is busy.
  • At 50% load there's about one in the system on average. At 90%, nine; at 99%, ninety-nine.
  • The readouts give the mean time in the system, for a server that handles 1000 per second, and the chance the buffer holds more than 20.

Predict

A link serves 1000 packets per second. Traffic rises from 800 to 900 per second. What happens to the average delay?

Name it

The M/M/1 queue

Arrivals are Poisson at rate λ, service times are exponential with rate μ, and there's one server. With utilization ρ=λμ<1:

  • the number in the system is geometric: P(n)=(1−ρ)ρn, so P(more than n)=ρn+1;
  • the mean number in the system is L=ρ1−ρ;
  • the mean time in the system is W=1μ−λ;
  • the mean wait before service starts is Wq=ρμ−λ.

At ρ≥1 the queue grows without bound.

Little's law

For any stable system, the average number inside equals the arrival rate times the average time spent inside:

L=λW

It needs no assumptions about the distributions. A router holding 4 packets on average while 800 per second pass through keeps each one for 5 ms.

Buffers

A finite buffer drops arrivals when full. For a buffer of N packets in an M/M/1 system, the overflow probability is about ρN+1 when it's small: each extra packet of buffer cuts losses by a factor ρ, which buys a lot at 50% load and very little near 100%.

Worked example

Packets arrive at 800 per second at a link that serves 1000 per second. Find the utilization, the mean number in the system and the mean delay.

Show the solution
  1. Utilization. ρ=0.8
  2. Mean number in the system. L=0.80.2=4packets
  3. Mean delay. W=11000−800s=5ms
  4. Check with Little's law. λW=800×0.005=4

Answer the utilization is 0.8, the mean number in the system 4 packets, and the mean delay 5 ms.

Worked example

At the same link, traffic rises to 900 per second. What happens?

Show the solution
  1. New figures. ρ=0.9 and L=9, and W=1100s=10ms
  2. Compare. A 12.5% increase in traffic more than doubled the number waiting and doubled the delay.
  3. What it means. The last 10% of capacity is the most expensive to use.

Answer the utilization rises to 0.9, the mean number in the system to 9 and the mean delay to 10 ms.

Worked example

At 80% load, how often does the system hold more than 20 packets?

Show the solution
  1. More than 20. P(more than 20)=ρ21=0.821=0.0092 about 1% of the time.
  2. A 20-packet buffer. A buffer of 20 packets would drop about 1% of arrivals.
  3. At 50% load. The same buffer would overflow with probability 0.521=5×10−7.

Answer it holds more than 20 packets 0.92% of the time, about 1%.

Check

Packets arrive at 800 per second at a server that handles 1000 per second. What is the mean time in the system?

Write units the way you normally would: 1.5 ms, 1500 µs and 0.0015 s are the same answer.

Check

An M/M/1 server is busy a fraction 0.8 of the time. How many are in the system on average?

Check

A system holds 3 jobs on average while 100 per second pass through. How long does each spend inside, on average?

Write units the way you normally would: 1.5 ms, 1500 µs and 0.0015 s are the same answer.

Check

At utilization 0.7, what is the chance an M/M/1 system holds more than 10?

Check

Arrivals at 600 per second, service at 1000 per second.

(a)

What is the utilization?

(b)

What is the mean wait before service starts?

Write units the way you normally would: 1.5 ms, 1500 µs and 0.0015 s are the same answer.

Check

Derive the M/M/1 mean from P(n)=(1−r)rn.

Step 1

What is ∑n(1−r)rn?

Type it the way you would write it, like 3sin(2πft) or 3*sin(2*pi*f*t). Angles can be in radians or carry a degree sign, like 45°.

Check

Simulate an M/M/1 queue with arrivals at 800 per second and service at 1000 per second for 200 000 packets (np.random.default_rng(3)): each packet starts service at the later of its arrival and the previous packet's departure. Set W to the mean time in the system, in ms.

Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.

Explain why

Why does delay grow so steeply as a queue's utilization approaches 100%, even when arrivals are below the service rate on average?

Practice

Keep practicing

7 kinds of problem on this topic, dealt one at a time with new numbers every time, for as long as you like.