The lab holds two stages, each given as a list of milliseconds:weight pairs. Stage A is mostly fast — 4 ms on more than half of calls — with a thin tail out to 70 ms. Stage B is slower and steadier, centred near 17 ms with a tail to 130 ms. They run one after the other, so the request takes the sum.
Definition · Convolution of two distributionsFor independent A and B taking values with probabilities P(a) and Q(b), the convolution is the distribution of A + B: the probability of a total t is the sum of P(a)·Q(b) over every pair with a + b = t. With finitely many outcomes it is computed by enumerating all the pairs, so it is exact and needs no approximation at all.
Take the two stages’ own percentiles first, by the rank rule of “Percentiles from a Sample”. Stage A has a p99 of 38 ms; stage B has a p99 of 72 ms. Add them and you get 110 ms, and that number appears in a great many latency budgets. Now compute the distribution of the sum and read its p99 off the same rank rule.
stage A 4:520 6:250 9:120 14:60 22:30 38:16 70:4
stage B 12:420 17:300 24:150 34:80 48:36 72:12 130:2
p50 p95 p99 mean
A 4 14 38 881/125 = 7.048
B 17 34 72 2414/125 = 19.312
added 21 48 110 659/25 = 26.360
A + B 21 52 78 659/25 = 26.360
p99(A + B) = 78 ms p99(A) + p99(B) = 110 ms gap 32 ms, 41.0%
cumulative at 77 ms: 24693/25000 = 0.98772 — short of 99/100
cumulative at 78 ms: 3096/3125 = 0.99072 — first to reach it
The true p99 of the two stages together is 78 ms. The sum of the p99s is 110 ms, which overstates it by 32 ms — 41.0%. Budgeting the pair at 110 ms reserves a third more time than the percentile being promised actually needs, and if that budget is what sizes a timeout or a machine count, the overstatement is paid for in capacity.
Read the two mean columns while you are here. 881/125 + 2414/125 is 3295/125, which is 659/25 — and 659/25 is exactly the mean of the convolved distribution. The added row and the true row agree to the last digit for means and disagree by a third for the p99. That is the whole lesson in one table: linearity of expectation is a theorem, and there is no theorem next to it for percentiles.
Why it is not a bound either
The natural repair is to keep adding the percentiles and call the result conservative. Look at the p95 row of the same table. The stage p95s are 14 ms and 34 ms, which add to 48 ms; the true p95 of the sum is 52 ms. Here the naive arithmetic understates by four milliseconds, on the very same pair of stages, at a percentile one step away.
So the sum of the percentiles is not an upper bound, not a lower bound, and not conservative. It is a number obtained by adding two quantities that were never addends. Whether it comes out high or low depends on how the mass beyond each stage’s percentile is arranged: when each stage’s tail is thin and far out, a single rare spike carries the pair over the line on its own and the true percentile can sit above the naive sum.
Example · How rare the naive answer actually isFor the total to reach 110 ms by both stages being at their p99 together, stage A must exceed 37 ms — probability 1/50 — and stage B must exceed 71 ms — probability 7/500. Independently that is 7/25000, or 0.0280%. The question asked was about the worst one percent of requests; the number returned describes the worst three in ten thousand. They are different questions with a factor of thirty-five between them.
What to do instead is in the lab. Convolve: enumerate the pairs, accumulate the probabilities onto their totals, and read the percentile of the result by rank. For two stages of seven outcomes that is forty-nine multiplications, every probability an exact fraction, and the answer is the percentile of the thing that was actually asked about.