Try
↑ ↓ move↵ openesc close

Interview prep / Queues as buffers

Mid · Queues as buffers · System design interview question

Why does latency rise so sharply as utilization approaches 100 percent, even when the average load is below capacity?

Sketch your own answer first, then compare it with the one below.

A strong answer

Arrivals are random. At low utilization the consumers are idle often enough to clear any clump of arrivals at once. Near full utilization there is almost no idle time, so a small clump leaves a backlog that takes a long time to drain, and the next clump lands on top of it.

In simple queueing models the average wait grows without bound as utilization approaches 1. The curve is flat at first and then bends up steeply, so a system that looks healthy at moderate load can fail with a small increase.

In practice, keep headroom and alarm on queue age, not only on CPU. Variable service times make the curve steeper still.

Sources

Learn it by running it

The queues as buffers lesson explains the mechanism behind this question, and its lab lets you change the parameters and watch the effect.

Your progress is saved in this browser. Sign in to keep it on every device. Privacy · Terms