A bidder can finish scoring within a nominal 120-millisecond timeout and still return too late. Queueing, dependency calls, response construction and network transport consume the same opportunity to deliver a usable response.

OpenRTB's tmax is expressed in milliseconds and includes Internet latency in the allowed response time. Treating the full value as an internal compute timeout leaves no protected time for the work outside that computation.

The practical task is to establish a local deadline from the integration's timing contract, preserve it through internal work and stop launching work that can no longer finish usefully.

Establish where your budget starts

Document the exchange's timing boundary and the information your ingress service actually receives. Your local process may not know how much upstream transport time has already elapsed.

Derive an admitted local budget using the available deadline information, measured transport behavior and integration agreement. Do not claim that starting a fresh tmax timer after parsing the request reconstructs the exchange's original deadline.

Record the observed ingress boundary as well. A timer starting when a worker dequeues the request excludes time the request already spent waiting for that worker.

For the synthetic example below, assume your ingress policy has already assigned a 120-millisecond local budget. The number is illustrative and is not a recommendation for an exchange or bidder.

Protect the response path with an explicit reserve

This complete Node.js example models remaining optional-work time. It uses an injected monotonic time coordinate rather than reading the current clock inside the function:

import assert from 'node:assert/strict'; function remainingBudget({ admittedMs, elapsedMs, reserveMs }) { if (![admittedMs, elapsedMs, reserveMs].every( n => Number.isFinite(n) && n >= 0 )) throw new TypeError('nonnegative finite timing values required'); return Math.max(0, admittedMs - elapsedMs - reserveMs); } assert.equal(remainingBudget({ admittedMs: 120, elapsedMs: 35, reserveMs: 25 }), 60); assert.equal(remainingBudget({ admittedMs: 120, elapsedMs: 95, reserveMs: 25 }), 0); assert.equal(remainingBudget({ admittedMs: 120, elapsedMs: 110, reserveMs: 25 }), 0); assert.throws(() => remainingBudget({ admittedMs: 120, elapsedMs: -1, reserveMs: 25 })); assert.throws(() => remainingBudget({ admittedMs: 120, elapsedMs: NaN, reserveMs: 25 })); 

At 35 milliseconds elapsed, the policy permits 60 milliseconds of additional work while protecting 25 milliseconds for the remaining path. The reserve is a local engineering choice derived from measurements, not a constant prescribed by OpenRTB.

At 95 milliseconds elapsed, the optional-work budget is exhausted. The system should follow its defined fallback or no-bid path rather than launch another dependency and hope the response still arrives in time.

Use monotonic time for durations within a process

A wall clock can change during a request. Use a monotonic clock such as Node.js performance.now() when calculating elapsed durations within one process.

Keep the start observation and later observations in the same clock domain. Subtracting an epoch timestamp from a monotonic timestamp produces a number with no useful meaning.

Across processes, define how you propagate deadlines and account for transport and clock assumptions. A raw performance.now() value from one process cannot be interpreted as the same coordinate in another process.

If your infrastructure propagates an absolute deadline, document clock synchronization assumptions and conversion at each boundary. If it propagates a remaining budget, account for the time spent in the handoff. Neither representation eliminates the need to define the timing contract.

Avoid resetting the timeout at every hop

Suppose ingress grants a dependency 60 milliseconds, and the dependency grants its own downstream call another full 60 milliseconds after doing local work. The second call has effectively extended the original budget.

Pass the remaining deadline context through the call graph. Before an optional call, compare its allowed duration with the remaining budget and the reserve needed after it returns.

The same rule applies to retries. A failed attempt does not create a new auction deadline. Decide whether another attempt can complete inside the time still available, rather than restarting a full timeout from the original request.

Be careful with timeout wrappers that only reject a local promise. They may leave the underlying network request or computation running. Where the client supports cancellation, propagate it, and still assume that cancellation may arrive after remote work has started.

Measure intervals without counting them twice

Record queue delay, parsing, dependency latency, scoring and response serialization with a common request correlation identifier. Preserve whether intervals run sequentially or overlap.

Adding two parallel dependency durations as if they were sequential overstates elapsed time. Looking only at scoring understates it. A trace with start and finish observations makes the critical path inspectable.

Examine tail behavior, not only averages. A reserve that covers a typical request may fail under queue pressure, connection setup or a slower dependency. Use measurements from the relevant deployment and update the policy deliberately.

Also record when the local response became ready and, where available, the exchange's observation of arrival. Local completion is useful evidence but does not directly establish remote deadline acceptance.

Exercise the deadline path before an incident

Use a fake clock for budget arithmetic and controlled delayed dependencies for integration tests. Test the exact cutoff, a completed dependency just before cutoff and a response that becomes ready after the allowed point.

Assert that exhausted budgets do not launch optional work. Verify that the fallback uses the exchange's supported timeout or no-bid behavior and does not emit a late response under an unrelated retry path.

Handle a missing or malformed tmax through an explicit ingress policy. Do not let a numeric conversion turn missing input into an unlimited timeout, or assume that zero means unlimited without checking the integration contract. Record which default or rejection rule applied.

I maintain RTBlint. Its OpenRTB request reference helps inspect tmax and related request fields. Pair payload checks with the measured service path, since structural validation cannot establish that your response reaches the exchange before its deadline.

Sources

Technical sources checked October 25, 2026. Drafted with AI; examples are synthetic unless explicitly stated otherwise.