Waiting for Parallel Dependencies

An operation asking several independent services can wait for all results or for a policy-defined subset. The elapsed time depends on the slowest needed result plus overhead.

Source
Anbloq
Language
English
Created
Updated
Chapters
4
Reading time
1 min
In this article4 chapters
  1. Trace two simplified calls
  2. Check which outputs are optional
  3. Add serial work and take the maximum of independent waits
  4. Verify what actually overlaps

Trace two simplified calls

If one reply takes 20 milliseconds and another 70, sequential calls take roughly 90 before other work. Starting together and needing both waits roughly 70. See total deadlines.

Check which outputs are optional

A partial result can be useful when an optional service times out if the response says what is missing. Signaled degradation defines that promise.[1]

Add serial work and take the maximum of independent waits

A service spends 10 milliseconds preparing requests, calls two independent dependencies taking 40 and 70 milliseconds, then spends 15 milliseconds combining results. Idealized parallel completion is 95 milliseconds, while sequential execution would take 135. See parallel critical path.

Shared preparation: 10 ms
Parallel stage: max(40,70)=70 ms
Final stage: 15 ms
Total: 95 ms in this simplified model

Verify what actually overlaps

A connection pool or shared capacity limit can serialize operations. A timeout also changes which results are present. Measure dispatch and completion in a representative environment before claiming the ideal improvement.

References

  1. Google, Site Reliability Engineering ↩