ContentsThe library

Running a Service That Stays Up

Nothing Degrades Gracefully

Last timeWhat Dependencies Cost

Waiting time does not rise in step with load. It rises with one over the remaining headroom, which means the last ten percent of capacity costs more than the first ninety.

Load rises smoothly. Latency does not. That mismatch is responsible for a large

share of outages that arrive with no warning, and it has a shape worth knowing

by heart.

Before any of it is arithmetic it is an ordinary scene. One clerk serves one

person at a time, and whoever the clerk cannot take right now waits in a line

behind a rope. Nothing about that line looks interesting while there is empty

rope left. What the rest of this lesson does is say precisely what happens as

the empty rope runs out.

FIG 1How long things wait as the system fills up
0.006.2512.5018.7525.000.10.30.50.70.9fraction of capacity in use
time in the systemtime spent waiting
Read the flat part carefully. Between ten and sixty percent utilisation almost nothing happens, which is the region most capacity planning is done in. Everything the plot has to say is in the last fifth, and by then there is no room left to react.

The curve

The denominator is the whole story. What governs the wait is not how much

capacity is being used but how much is left, and as that remainder approaches

zero its reciprocal approaches infinity.

FIG 2One service, four steps up in traffic
stepfraction of capacity in usetime in the systemincrease over the previous stepwhat happened
10.521Half the capacity in use. Each job takes twice its service time, which nobody notices.
20.852.5A large traffic increase, and the response time has only gone up by a factor of two and a half.
30.9102A much smaller traffic increase, and the response time doubles again.
40.95202A tiny traffic increase, and it doubles once more. This is the step people describe as the service falling over.
4 steps
The traffic increases get smaller as the table goes down and the damage gets larger. Anyone watching the load number sees a gentle line right up to the last row, which is why saturation outages are so consistently described as having come out of nowhere.
FIG 3Little's law
how many jobs are in the system at any moment
how many arrive per second
how long each one spends in the system
This holds for any arrival pattern and any service order, which is unusual and useful. Measure any two of the three and the third is determined, so it is the quickest available check on whether a dashboard is counting what it claims to. A queue depth that disagrees with the arrival rate and the latency is a measurement bug.

The relation that never lies

Used in the other direction it also sets a bound: if a thousand requests arrive

per second and each must finish within a tenth of a second, then no more than a

hundred can be in flight at once. That is a concurrency limit derived rather

than guessed, and it is the right number to enforce.

The lesson stops here

2 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 contents

This 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

The rest of this course

  1. 01Available to Whom, Exactly
  2. 02The Gap Between Your Target and Perfection Is a Resourceopening only
  3. 03The Average Is the Enemyopening only
  4. 04A Chain of Reliable Parts Is Not Reliableopening only
  5. 05Nothing Degrades Gracefullyyou are here
  6. 06The Service Was Fine Until Somebody Changed Itopening only
  7. 07The Helpful Client That Finishes the Jobopening only
  8. 08A Pager That Everyone Trustsopening only

Read alongside