· Junsung Park (CEO) · Technology  · 6 min read

Not by Statistics but by Structure — Enforcing a Worst-Case Latency Bound

In the last post we told the story of moving the time-bound gate that cuts aged requests behind the last aging point. This post is about what *kind* of guarantee that gate gives.

In the last post we told the story of moving the time-bound gate that cuts aged requests behind the last aging point. This post is about what *kind* of guarantee that gate gives.

In the last post we told the story of moving the time-bound gate that cuts aged requests behind the last aging point. This post is about what kind of guarantee that gate gives.

p99 and worst-case are different promises

When we talk about latency, we usually talk about a distribution: p99 is so many milliseconds, the tail looks like this. But “p99 is good” and “the worst case is bound” are different kinds of promises. The former is nothing more than a histogram drawn after the fact, from observing the requests that passed through the system. The latter means structurally pre-blocking a request nearing its timeout so that it cannot get out of the system at all.

From the bidder’s point of view, this difference is real. However good p99 is, if the 1% outside it are bids that missed the deadline, the downstream machine-learning pipeline throws that computation away whole. The promise we wanted to make to the downstream was not the average but the cutoff — the maximum.

What a structural guarantee is

The definition is one line. A request that goes out has, by definition, a residence time at or below the bound T. A request whose age has passed T has no path out. Either it is dropped, or it goes out with a residence time at most T. There is nothing in between.

This is not a proposition that measurement confirms; it is a proposition that the structure of the gate enforces. A statistical guarantee watches the distribution and tells you when it gets worse. A structural guarantee removes the path to getting worse in the first place. The two differ as much as monitoring differs from enforcement.

For this proposition to hold, the gate must sit behind the last point where a request can age. Put it in front, and after clearing the gate the request ages more, and the definition quietly breaks. That is exactly why we moved the gate three times in the last post.

And what we measure is the time a request spends inside our system — from arrival to physical transmission. The inbound network segment, the network segment after we send, and the downstream’s own computation time are not what we bind; they are the budget left to the downstream. Within that boundary, the age of a request we send out is at or below the bound.

Boundaries and failure modes, honestly

A structural guarantee is tested at the boundaries. We had to make a choice at two points.

First, when the age is exactly equal to the bound. This one we pass. T is a value that must not be exceeded, and a request that is exactly T has not yet crossed the line.

Second, when the clock is skewed and computing the age itself becomes impossible. If the arrival time and the current time disagree, the age comes out as a negative-looking number or a nonsensical value. Here, instead of passing the request, we drop it. There was an alternative — clamp the age to zero and pass it — but we rejected it. If the skew is large, we could mistake an actually aged request for a fresh one and quietly break the guarantee. The principle we chose is fail-safe. Even if we judge wrong, the result is over-blocking, not a guarantee violation. In a system that stakes a guarantee, the worst failure is sending out an aged request dressed up as fresh while everything looks fine on the surface. Better to drop the ambiguous case than that.

There is no universally optimal value of the bound T

We do not decide what T should be. T comes from the time the downstream machine learning will spend within its tmax budget, so it differs per deployment. What we can speak to is only the shape of the curve. Lower T and the bound gets tighter but you drop more; raise it and you drop less but the bound loosens. The direction of this trade-off is the same everywhere, and which point on the curve you pick is set by that deployment’s downstream budget. The concrete drop rate and T value are numbers specific to the traffic and environment, so we do not put them here. What is portable is the shape of the curve, not the coordinates.1

Closing

Whether this guarantee actually stands, we checked twice. Once by replaying the arrival timing of a real pilot onto the gated path, and once with the residence time the gate actually read in live execution. In both, there was no case where a delivered request’s residence exceeded the bound (zero violations).2

One line to leave it on: a guarantee is not something you confirm by measurement but something you enforce by structure, and measurement is used to show that the structure stands.


We build a low-latency traffic filtering system that structurally controls tail latency for real-time bidding infrastructure.

If you want to test this gate on your real service traffic with no impact, you can start with a traffic-mirroring-based shadow-mode pilot.

Footnotes

  1. The drop rate per bound was actually measured in the pilot replay, but that value is a number for this traffic and this environment. The portable information is the direction of the trade-off — “lower T and you drop more, raise it and you drop less” — not specific coordinates, so we do not put it in a table.

  2. Zero violations was confirmed in two measurements. One is the pilot timing replay — from the recorded timing of real pilot traffic we restored the per-record residence values, injected them into the gated send path, and exhaustively checked whether the total residence just before transmission exceeded the bound. This residence value is an end-to-end measurement that includes the network segment from sender to receiver, so counting only the residence inside our system it is a conservative baseline with more headroom than this. The other is a bare-metal live-path execution — with the in-system residence time the gate actually read, we directly confirmed it was at or below the bound. Both were zero violations, and absolute values are environment-specific and not extrapolated to other environments.

Back to Blog

Related Posts

View All Posts »
The Dial for Choosing What to Drop

The Dial for Choosing What to Drop

In the previous post, we placed the time-bound gate behind the last point where delay accumulates, and from that we earned a structural guarantee: any request that goes out is, without exception, at or below the residence-time bound.

버릴 것을 고르는 손잡이

버릴 것을 고르는 손잡이

앞선 글에서 저희는 '시간 상한 게이트'를 지연이 생기는 마지막 지점 뒤에 두었습니다. 그렇게 해서 '밖으로 나간 요청은 무조건 체류 시간 상한 이하'라는 구조적 보장을 얻어냈죠.

Where Did 18.5 Milliseconds Come From

Where Did 18.5 Milliseconds Come From

In real-time bidding, a response that misses tmax is worth zero. No matter how sophisticated the bidder, a bid that arrives after the deadline is simply thrown away. So the number I chased was not the average but the tail latency. This post is the record of tracking down one such tail.

18.5밀리초는 어디서 왔는가

18.5밀리초는 어디서 왔는가

실시간 입찰(RTB) 환경에서 응답 기한을 넘긴 입찰은 가치가 0입니다. 아무리 정교한 비더를 만들었더라도, 마감이 지난 뒤에 도착한 응답은 그대로 버려지기 때문입니다. 그래서 제가 추적해야 했던 숫자는 평균 지연 시간이 아니라 '꼬리 지연'이었습니다. 이 글은 그 꼬리 지연 하나를 집요하게 추적하고 해결한 기록입니다.