02 · Latency & retries

Every attempt is load

A timeout means the caller stopped waiting. The dependency may still be working—or may already have committed the operation.

The model

First attempts + retries = downstream work. If a retry overlaps its unfinished predecessor, one user request occupies multiple workers. More waiting can trigger more retries: a feedback loop.

Bound attempts within one overall deadline. Backoff and jitter spread retries out; they do not make unsafe side effects repeatable. Retried writes need an idempotency mechanism.

Retries add work without adding usersSearch sends one hundred first attempts and fifty retries each second to the ranker. The ranker receives one hundred fifty attempts per second but can complete only one hundred twenty, leaving thirty more queued each second. First attempts100 /s Retries50 /s Ranker receives 150 attempts/sCapacity: 120 completions/s Queue grows by 30 attempts/s
Illustrative — one queue, no other callers or dropped work.

Worked example

Search receives 100 requests/s. Its retry counter shows another 50 attempts/s, so the ranker receives 150/s: 1.5 attempts per request. At a measured capacity of 120/s, queued work grows by 30/s.

Here the retry counter explains the increase. A higher dependency rate alone could instead mean fan-out, another caller, or a changed cache hit rate. Attribute the extra work before choosing a change.

Commands worth running

Use fictional service names below as placeholders, in the caller’s namespace.

kubectl logs deployment/search \
  --since=5m --timestamps

Take one failed request ID and its deadline from the caller’s incident window. Deployment logs show one pod, not the whole fleet.

kubectl logs deployment/ranker \
  --since=5m --timestamps

Find that ID downstream. Later completion can explain a caller timeout; repeated arrivals support the retry hypothesis.

curl -sS --max-time 0.25 -o /dev/null \
  -w 'HTTP %{http_code}\n' http://ranker:8080/rank

Cap the whole transfer at 250 ms. Exit 28 means curl timed out; it does not establish that server work stopped.

Self-check

References

Practise it