Running a Service That Stays Up
The Average Is the Enemy
Last timeThe Budget You Are Allowed to Spend
A mean response time can look excellent while a large minority of users are having a terrible experience, and a page that makes many calls meets the slow tail on almost every load.
There is a statistic that makes almost every service look healthy, and most
dashboards lead with it.
| step | mean, in milliseconds | ninety-ninth percentile | users who waited over a second | what happened |
|---|---|---|---|---|
| 1 | 50 | 50 | 0 | All hundred requests take fifty milliseconds. Everything agrees. |
| 2 | 99 | 5000 | 1 | One request now takes five seconds. The mean has barely moved, the percentile has told the truth, and one user in a hundred is gone. |
What an average does to a tail
That is the whole argument against the mean as a health metric. It is
insensitive to exactly the events that matter, because the events that matter
are rare and the mean divides by the count.
Reading a percentile
The ninety-ninth percentile is the response time such that ninety-nine percent
of requests were faster. It names a position in the ordering rather than
averaging anything, which makes it robust: one absurd outlier cannot move it,
but a genuine worsening of the slow end does.
The lesson stops here
4 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