Glossary / Jitter

Jitter

Jitter adds randomness to retry or polling delays so many clients do not act in lockstep. If a service outage causes thousands of clients to retry at the same fixed exponential intervals, those synchronized bursts can keep the service overloaded. Randomized delays spread demand over time and reduce correlated load spikes.

Common strategies

The exact distribution should match the system’s objectives. Full jitter can produce very short delays; equal jitter may enforce a minimum. Respect server Retry-After instructions and add jitter around them only if policy permits. Jitter does not make unsafe retries safe and does not replace attempt/deadline limits.

const ceiling = Math.min(cap, base * 2 ** attempt);
const delayMs = Math.random() * ceiling; // full jitter

Use an injectable random source for deterministic tests. Record actual delay and attempt metrics. Apply jitter to fleet-wide scheduled polling as well as retries when synchronized clients are a risk.

Interview questions

  1. What problem does jitter solve? Synchronized clients causing retry thundering herds.
  2. What is full jitter? Random delay from zero up to the current capped backoff.
  3. Does jitter replace idempotency? No.
  4. How test jitter logic? Inject a deterministic random source and verify bounds/distribution logic.

References