When the Queue Fills Up
Last timeThe Average Is Not the Experience
When arrivals exceed capacity the only choices are to queue, to shed, or to collapse. Choosing deliberately is the difference between a degraded service and no service.
Shed or queue
The first lesson said that if arrivals exceed capacity the queue grows without
limit. This lesson is about what to do when that happens, because it will.
There are only three outcomes available. Queue the excess, refuse the excess, or
collapse. The third is what happens when the first is chosen without a limit,
and it is worth being precise about why.
Work that waits longer than the client is willing to wait is work that will be
abandoned. The client gives up, and the request is still in the queue, so when a
server eventually reaches it, it does the work and sends the answer to nobody.
That capacity has been spent producing nothing. Worse, the client that gave up
usually retries, so the abandoned request has also generated a new arrival.
Beyond a certain depth, every item admitted makes the service slower without
making anybody happier, and the useful throughput falls while the system is
working as hard as it can.
That collapse is the reason bounded queues are not a detail of tuning. An
unbounded queue does not protect the system from overload, it converts a
recoverable capacity problem into a total failure whose symptoms appear
everywhere except the place that caused it.
How much to shed
Shedding is usually improvised during an incident and it does not need to be,
because the amount is a calculation.
The lesson stops here
5 more paragraphs to go
You have read the opening. The rest of the argument, the problems that check whether it landed, and the lines worth keeping at the end all come with a plan.
The first lesson of every course in the library reads the whole way through, free, so you can see exactly what the rest of them are.
See the planThe contentsThis is the reading half
Starting the course gives you your own copy of it. Every idea on every page has problems standing under it, marked with a reason rather than a tick, and any sentence you do not believe can be opened and argued with. None of that can happen on a page nobody owns.
The contents