retry-storm-backoff · EN · 2026-10-20

When a Single Failure Retries Into a Storm: Backoff Across Aggregated Backends

Naive client retries can multiply with aggregator-side retries, causing retry storms and unexpected costs. Learn how to design idempotency, jitter, and per-model concurrency caps to keep one 429 from doubling your bill.

When you call an aggregated API that fronts multiple model backends, a single failed request can trigger retries at multiple layers. If your client retries naively and the aggregator also retries on your behalf, those retries can multiply, turning a transient error into a storm of duplicate requests and inflated costs. This guide explains the mechanics and how to choose idempotency, jitter, and concurrency caps to keep failures from cascading.

The retry multiplication problem

Consider a request that fails with a 429 (rate limit) or 5xx error. Your client might retry up to N times. The aggregator, upon receiving your request, might also retry up to M times if the backend returns a retryable error. In the worst case, a single logical request becomes N × M attempts. Each attempt may consume tokens and incur charges, even if the final response is an error or a duplicate.

This multiplication is especially dangerous when:

  • The aggregator retries on behalf of all clients, so your retries add to the load.
  • Backoff is not coordinated, so retries from many clients align and create spikes.
  • The operation is not idempotent, so duplicate attempts cause side effects (e.g., double billing if the provider charges per attempt).

Idempotency: make retries safe

Idempotency ensures that repeating the same request has the same effect as making it once. For API calls, this usually means including a unique idempotency key (e.g., a UUID) in the request header. The server records the key and returns the same response for subsequent requests with that key, without re-executing the operation.

When using an aggregated API, check whether it supports idempotency keys. If it does, generate a key per logical request and reuse it across retries. This prevents duplicate charges if the aggregator or backend deduplicates on the key.

If the aggregator does not support idempotency keys, you must rely on other strategies, such as limiting retries and using concurrency caps, to reduce the chance of duplicate work.

Jitter: break the synchronization

Backoff without jitter causes clients to retry at the same intervals, creating thundering herds. Jitter adds randomness to the delay, spreading retries over time. Common approaches include:

  • Full jitter: sleep for a random duration between 0 and the calculated backoff.
  • Equal jitter: sleep for half the backoff plus a random duration up to half.
  • Decorrelated jitter: increase the backoff based on the previous delay and a random factor.

Apply jitter at the client level. If the aggregator also retries, its jitter may not align with yours, but client-side jitter still reduces the chance that your retries coincide with others.

Per-model concurrency caps

Different models have different rate limits and cost profiles. A single concurrency cap for all models can be too restrictive for some and too permissive for others. Instead, set per-model concurrency limits on the client side:

  • Track in-flight requests per model.
  • When the limit is reached, queue or reject new requests according to your policy.
  • Adjust limits based on observed 429 rates and latency.

This prevents a surge of retries for one model from consuming all your capacity and affecting other models. It also reduces the load on the aggregator, lowering the chance of triggering aggregator-side retries.

Putting it together

A robust retry strategy for aggregated backends combines:

  • Idempotency keys (if supported) to deduplicate retries.
  • Exponential backoff with jitter to avoid synchronized retries.
  • Per-model concurrency caps to isolate failures and control load.
  • Limited retry counts to cap the multiplication factor.

Additionally, monitor retry rates and 429 responses. If you see many retries, investigate whether your client is over-retrying or whether the aggregator is retrying on your behalf. Adjust your strategy accordingly.

By designing retries with these principles, you can prevent a single 429 from turning into a storm that doubles your bill.