date: 2026-11-08

title: "Jittered Backoff: Stopping Agent Pipelines from Amplifying Upstream Failures"

author: Brian Taylor


Jittered Backoff: Stopping Agent Pipelines from Amplifying Upstream Failures

When a trend-scout or content-agent pipeline retries failed fetches and syncs, the default pattern — retry immediately, then retry on the same schedule for every worker — turns a brief upstream hiccup into a self-inflicted outage. Idempotency keys keep retries safe; they do not keep retries polite. Decorrelating the schedule is a separate, equally necessary discipline.

The stampede problem

An upstream provider returns a 429, a 503, or a connection timeout. Every worker that failed in the same window now waits the same interval and retries together. Even with backoff, identical schedules synchronize. AWS's simulation of optimistic-concurrency updates under contention shows the canonical shape: with N contending clients, work scales roughly as N^2; exponential backoff reduces spikes only modestly because many clients still retry in clusters; adding jitter spreads retry times into an approximately constant rate and, in their 100-client case, more than halves total calls while completing faster than no-jitter backoff.

The relevant point is structural, not OCC-specific: any shared backoff schedule produces recovery-window spikes.

What backoff alone does and does not do

Capped exponential backoff (min(cap, base * 2^attempt)) slows clients, but leaves intact the correlation created by the common failure time. Clients that failed together retry together. Without jitter, you get a delayed thundering herd. Backoff solves magnitude of interval; it does not solve timing distribution.

Jitter is the fix

Jitter adds randomness to spread retries. Variants (per the AWS Architecture Blog and prismatic guidance):

  • Full jitter: sleep = random(0, min(cap, base * 2^attempt)). Strong default when shedding load is the priority; randomizes fully.
  • Equal jitter: temp = min(cap, base * 2^attempt); sleep = temp/2 + random(0, temp/2). Prevents very short sleeps, always keeping some slowdown.
  • Decorrelated jitter: sleep = min(cap, random(base, previous * 3)). Increases the maximum jitter based on the last random value; smooth ramp independent of attempt count.

Practical comparison from the AWS study: no-jitter backoff is the clear loser in both calls and time. Full and equal jitter cut calls deeply; full jitter does slightly fewer calls at slight cost in time, equal jitter is slower. Decorrelated is a good option when you cannot track attempt counts. Many HTTP client libraries now ship retryBackoff knobs with these exact strategies.

Agent-pipeline specifics beyond generic HTTP retries

  • Fetch sources conditionally. For RSS/JSON feeds and pages, send If-None-Match/If-Modified-Since and treat 304 as no new work. Skipping transfer and parsing also shrinks downstream retry volume.
  • Honor Retry-After. A 429 with that header overrides computed delay; never exceed provider requests/minute limits just because cap is higher.
  • Per-remote, not per-task, caps. Three trend-scout sources all reading Gmail/Drive at the same time should share one limiter.
  • Retry budgets. Cap retries per minute globally, not per call; exceeded budget must fail or queue, not spawn more attempts.
  • Classify failures. Retry only transient status codes (429, 500, 502, 503, 504, timeouts). Do not retry 400/401/403/404; log and skip instead.
  • Keep the idempotency key invariant. Backoff changes timing, not correctness; a retried publication must still use the same event_key.

Correlated failure grows in multi-job setups

Cron pipelines run at top-of-hour by default. Several independent jobs can hit the same provider together. Add schedule jitter (a few seconds to minutes) at dispatch time, not only in retry loops. Watch cross-job interactions: idempotency covers duplicate writes; jitter covers duplicate pressure.

Summary

Backoff controls interval size; jitter controls timing spread. Together with per-remote rate limits, retry budgets, conditional requests, and strict transient-vs-permanent classification, this covers the dispatch side complementary to idempotent writes and overlap locking.

Sources