Stackbook Logo
resilienceestablished · low operational burden

Retry Budget

Also known as: retry-throttling, retry-ratio-limit

Intent

Limit retries to a fixed fraction of normal traffic so retries help with transient errors but cannot amplify an outage.

Problem

When a dependency is failing, every client retrying each failed call multiplies load, and layered retries across tiers multiply it again. The extra load prevents the dependency from recovering.

Forces

  • •Transient errors benefit from retries
  • •Retries add load exactly when capacity is scarce
  • •Layered clients multiply retries
  • •Per-request limits do not bound aggregate load

Solution

Overview

A retry budget answers the question that per-request retry counts cannot, namely how much extra load retries are allowed to add in total. Envoy and gRPC both ship the idea as configuration.

How it works

Maintain a token bucket per destination. Successful calls deposit a fraction of a token, and each retry withdraws a whole one.

ratio = 0.1
on success:  tokens = min(max, tokens + ratio)
on failure:
  if tokens >= 1 then tokens -= 1; retry
  else fail fast

With a ratio of 0.1, retries can never exceed ten percent of successful traffic in steady state. During a full outage the bucket drains and retries stop, so the client falls back to a single attempt per request. A small minimum allowance keeps low-traffic clients functional.

Pitfalls

  • If three tiers each retry three times, one failure can produce 27 calls. Retry at one layer and propagate errors upward.
  • Counting retries per endpoint but sharing the budget per host can hide a hot endpoint.
  • A budget does not replace backoff, since synchronized retries still spike without jitter.
  • Retrying non-idempotent calls remains unsafe whatever the budget.
  • Do not count rejected retries as errors twice in dashboards.

Key takeaways

  • Bound retries by ratio, not just by count.
  • Use token buckets fed by successes.
  • Retry in exactly one layer.
  • Combine with backoff, jitter, and circuit breakers.
  • Expose the remaining budget as a metric so operators can see when retries are being suppressed and correlate it with downstream error rates.

✓ When to Use

  • •Service meshes and client libraries making many calls
  • •Deep call chains with retries at multiple layers
  • •Dependencies prone to brownouts under load

✗ When Not to Use

  • •Low-volume clients where a ratio is meaningless
  • •Non-retryable operations
  • •When retries are already handled at a single controlled layer

Pros

  • +Caps worst-case amplification
  • +Still allows retries during isolated errors
  • +Cheap to implement

Cons

  • −Some recoverable requests fail when budget runs out
  • −Ratio and window need tuning
  • −Per-process budgets do not bound fleet-wide load exactly

Cost Profile

Infrastructure

None, client-side counter

Operational

Low, monitor budget exhaustion

Cognitive

Low, simple concept

Failure Modes

  • Budget too small turns brief blips into user-visible errors

  • Retries at multiple layers each with own budget still compound

  • Budget shared across unrelated endpoints starves a healthy one

Real-World Examples

Alternatives

    Related Patterns

    • retry-with-backoff
    • circuit-breaker

    Competency Domains

    reliability opsdistribution communication