Definition · Fleet percentileGiven the requests served by every host in a fleet over a window, the fleet q-th percentile is the q-th percentile of that single merged sample: sort all n latencies and take the one at position ⌈q·n⌉. It is computed from requests, not from per-host summaries, and every request counts once.
There is no second definition. The bucketed percentile of “Histograms and Bucket Error” and the corrected percentile of “Coordinated Omission” are this same rule applied to a coarsened sample and to a repaired one. Where two of this course’s numbers disagree, the disagreement is about which requests were in the sample, never about what a percentile is.
The number a metrics system usually makes easy, by contrast, is one p99 per host per minute, and the obvious thing to do with several of those is to average them. That average has a name in no textbook. It is not the fleet p99, it is not an estimate of the fleet p99, and it does not converge to the fleet p99 as the window grows.
host A 8, 9, 10, 11, 12 5 requests
host B 10, 11, 12, 13, 14 5 requests
host C 150×20, 180×20, 220×20, 260×15, 320×10, 400×5 90 requests
per host, nearest rank at q = 99/100:
A ⌈0.99×5⌉ = 5 of 5 → 12 ms
B ⌈0.99×5⌉ = 5 of 5 → 14 ms
C ⌈0.99×90⌉ = 90 of 90 → 400 ms
mean of the three = (12 + 14 + 400)/3 = 142 ms
merged sample, n = 100:
fleet p99 ⌈0.99×100⌉ = 99 of 100 → 400 ms
fleet p50 ⌈0.50×100⌉ = 50 of 100 → 180 ms
Read the last three lines together. The average of three 99th percentiles is 142 ms; the fleet’s median is 180 ms. The number being presented as a statement about the slowest one per cent of requests is smaller than the number that half of all requests beat. It is not a slightly optimistic p99. It is below the middle.
Theorem · The fleet percentile lies between the smallest and the largest per-host percentileLet host i have nᵢ requests and q-th percentile pᵢ, and let M = max pᵢ. At least a fraction q of each host’s requests are at most pᵢ ≤ M, so at least a fraction q of all Σnᵢ requests are at most M, and the merged q-th percentile is therefore at most M. Running the argument with m = min pᵢ from the other side gives
min pᵢ ≤ fleet p ≤ max pᵢ.
One corollary is worth stating because the folklore gets it backwards: if every host reports the same p99, the fleet p99 is that number exactly — the bound closes. Percentiles fail to average, but they do not fail by leaving the range of the values being averaged.
So the mean of the per-host values is always somewhere plausible, and it is why nobody notices. What the bound does not give you is the value: anywhere inside [min, max] is consistent with the per-host figures, and where the fleet value actually falls depends on data the per-host summaries threw away.
The per-host percentiles do not determine the fleet percentile
That claim deserves a demonstration rather than an assertion, so here are two fleets. Both have two hosts, both hosts serve a hundred requests, and in both fleets the two host p99s are 40 ms and 100 ms. The fleet p99 is not the same number in the two cases.
Example · Two fleets, the same pair of host p99s, two different answersFleet one. Host X is 98 requests at 10 ms, one at 40, one at 50; its p99 is position 99 of 100, which is 40 ms. Host Y is 98 at 20 ms, one at 100, one at 200; its p99 is 100 ms. Merged, n = 200 and the fleet p99 is position 198, which is 50 ms.
Fleet two. Host X is 98 at 10 ms and two at 40; its p99 is again 40 ms. Host Y is 96 at 30 ms and four at 100; its p99 is again 100 ms. Merged, position 198 of 200 is 100 ms.
Same two host p99s, fleet answers of 50 ms and 100 ms. The average, 70 ms, is a fact about neither fleet, and it is not even between the two right answers in any useful sense: it is above one and below the other. Both fleet values sit inside [40, 100], exactly as the bound promises, and the bound is the most that can be said without the requests.
What you can combine, and what to keep instead
Counts and sums combine, because they are additive: total requests, total errors, total milliseconds. A ratio of two sums is fine — the fleet error rate really is the sum of the errors over the sum of the requests — and so is a mean weighted by its own denominator. It is the order statistics that do not: a percentile, a median, a maximum-of-percentiles all need the sample.
The practical answer is to keep something mergeable. A histogram of counts per bucket adds bucket by bucket, and the percentile is read off the merged histogram rather than averaged across hosts; that is what almost every metrics system is doing when it gets this right. It costs an interval instead of a point, which is the subject of the next page, and an interval that contains the answer is a better object than a point that does not.