Dividing a Deadline Among Service Calls

A request deadline can be budgeted across local work and dependencies so each operation respects the work still possible.

Source
Anbloq
Language
English
Created
Updated
Chapters
4
Reading time
1 min
In this article4 chapters
  1. Calculate a simple split
  2. Propagate the correct limit
  3. Subtract elapsed work from an overall deadline
  4. Test sequential costs and parallel limits separately

Calculate a simple split

With a 100-millisecond goal and 20 already spent, at most 80 remain. Reserve final response time before making another attempt. Retry budget and deadlines apply the arithmetic.

Propagate the correct limit

A dependency receiving a new full timeout may continue after its caller cannot use the result. Latency budgets detail how serial work and measurements interact.[1]

Subtract elapsed work from an overall deadline

A caller has 500 milliseconds. Validation and earlier work consume 110, and serialization needs a 40-millisecond allowance. The next dependency call can use at most 350 milliseconds under this budget. Copying the original limit to every downstream request could exceed it. See request timeouts.

Starting budget 500 ms
Used 110 ms
Reserve 40 ms for response work
Maximum next dependency time 350 ms

Test sequential costs and parallel limits separately

Parallel requests can share the same wall-time deadline. Sequential calls consume its remaining budget. Measure each phase with an elapsed clock and test the exhaustion path before launching more work.

References

  1. Google, Site Reliability Engineering ↩