Try
↑ ↓ move↵ openesc close

Interview prep / Distributed tracing

Mid · Distributed tracing · System design interview question

Each backend call is slow one time in a hundred. A request calls a hundred backends in parallel. Roughly how often is the request slow, and what does this say about tail latency?

Sketch your own answer first, then compare it with the one below.

A strong answer

If the calls are independent, the chance that all hundred are fast is 0.99 multiplied by itself a hundred times, a little over a third. So the request meets at least one slow call about two times in three. The general form is one minus the fast probability to the power of the number of calls.

The point is that rare slowness in a part becomes common slowness in the whole when a request fans out and waits for the slowest. Tail latency of the components decides the typical experience of the service.

Mitigations include fewer calls per request, hedged or duplicated requests after a short delay, tolerating missing results, and fixing the causes of slow calls. The independence assumption flatters the system. Slow calls often cluster, for instance on one bad host.

Sources

Learn it by running it

The distributed tracing lesson explains the mechanism behind this question, and its lab lets you change the parameters and watch the effect.

Your progress is saved in this browser. Sign in to keep it on every device. Privacy · Terms