The objective on the lab’s preset is a p99 of 400 ms. The route has a light-speed floor of 56 ms — the New York to London figure from “The Speed-of-Light Floor”, rounded to the nearest millisecond — and the connection costs two sequential round trips at the measured 76 ms, which is 152 ms. Those two are not negotiable and they are subtracted before anything else happens.
SLO 400 ms
− light-speed floor −56 ms
− handshake round trips (2 × 76 ms) −152 ms
────────
available for the code 192 ms
four stages, even share = 192 / 4 = 48 ms each
stage floor share residual
gateway 8 48 +40 fits
auth 20 48 +28 fits
search 150 48 −102 does not fit
render 40 48 +8 fits
────────
floors total 218 192 − 218 = −26 ms
spare +76 need 102 76 − 102 = −26 ms ✓
The two ways of counting the shortfall agree, which is the check the lab performs on every redraw: available minus the floors is −26 ms, and the surplus the fitting stages release minus the shortfall of the one that does not is also −26 ms. An allocation that does not balance both ways has an arithmetic error in it, and the panel says so when it happens.
Definition · ResidualA stage’s residual is its allocated share minus its own floor: the time it has left to spend on work that is not already forced. A positive residual is headroom the stage can release to another stage. A negative residual is a stage that cannot meet its allocation under any implementation, and the overall residual — available time minus the sum of the floors — says whether the whole plan is feasible.
Reading a plan that does not fit
The even split is a diagnostic, not a design. Nobody believes a gateway and a search engine deserve the same 48 ms; the split is there because it shows in one line which stage the objective cannot hold. Here it is search, by 102 ms, and the three other stages together have only 76 ms to give. Four things can be done and the arithmetic prices each of them.
- raise the objective — at a 500 ms SLO the available time is 292 ms and the overall residual becomes +74 ms
- remove a floor — dropping the two handshakes takes available to 344 ms and the residual to +126 ms
- make search cheaper — at a 100 ms floor the plan has +24 ms overall, though search still exceeds an even share
- take work off the critical path — which is the graph question of “Serial Sums, Parallel Maxes”, not a budgeting one
The third of those is worth pausing on. Cut search to a 100 ms floor and the overall residual turns positive at +24 ms, but search is still 52 ms above the even share of 48 ms and the lab still marks it as not fitting. Both statements are true and they mean different things: the plan is now feasible, and it is feasible only because the other three stages are subsidising the fourth. The even split is what makes that visible.
Example · Why the SLO has to be a percentile all the way downIf the objective is a p99, then every floor and every allocation in the table is a p99, and the stage figures cannot be means. A budget built by summing mean stage times will fit comfortably and be violated on most slow requests: on the stages of “Percentiles Do Not Add” the mean of the total is 26.36 ms and its p99 is 78 ms, a factor of three. Choosing the statistic is the first line of the budget, not an afterthought.
There is one more trap, and it is the one the previous lesson exists to prevent. Having filled in a p99 for every stage, it is natural to add them and compare the total with the objective. That total is not the p99 of anything. On the two stages of “Percentiles Do Not Add” it overstated by 41.0%, and on a different pair it would understate. A budget is a planning device built from per-stage allocations; the end-to-end percentile it implies has to be computed by convolution, and the two should be checked against each other rather than assumed equal.