Meaning
Equal jitter backoff is a retry delay algorithm that combines exponential growth with a deterministic half‑delay and a random half‑delay. It addresses the thundering‑herd problem by spreading retries over a bounded interval. It is used when a client must retry an operation after a transient failure and wants to avoid synchronized bursts of traffic.
Primary Function
Retry strategy
Communicative Purpose
Mitigates thundering‑herd spikes by randomizing retry intervals while keeping a predictable minimum delay.
Pattern
calculate backoff → add equal jitter → sleep
Core Structure
sleep = backoff/2 + random(0, backoff/2)
Função primária
Retry strategy
Propósito comunicativo
Mitigates thundering‑herd spikes by randomizing retry intervals while keeping a predictable minimum delay.
Situações de gatilho
Distributed systems: retrying failed HTTP requests after transient errors; Microservices: handling HTTP 429 rate‑limit responses; Message queues: reprocessing messages after a temporary broker outage
Contextos
Cloud services, client libraries, networking code, distributed job schedulers, API clients
Padrão
calculate backoff → add equal jitter → sleep
Estrutura central
sleep = backoff/2 + random(0, backoff/2)
Colocados típicos
- exponential backoff
- random jitter
- retry loop
- circuit breaker
- backoff cap
Substituições comuns
- full jitter backoff – uses only random delay
- more variance
- decorrelated jitter – changes backoff each attempt
- avoids long tails
- fixed delay – constant interval
- simpler but can cause synchronized retries
Erros comuns
Using equal jitter without a maximum cap → backoff can grow unbounded; Adding jitter twice (full + equal) → delays become excessive; Miscalculating backoff/2 with integer division → loss of precision and shorter delays
Similar / contraste
Full jitter backoff – replaces the deterministic half with full randomness; Decorrelated jitter – recomputes backoff based on previous delay, reducing correlation; Fixed delay – constant interval, no exponential growth
Interferências
Coming from JavaScript: using setTimeout with a constant delay → misses jitter benefits — replace with equal jitter calculation; Coming from Bash scripts: relying on sleep without randomness → can cause synchronized retries — implement equal jitter algorithm instead
Família do chunk
- Exponential backoff
- Full jitter backoff
- Decorrelated jitter backoff
- Retry loop
- Circuit breaker
Nuance
1) Do not use when strict timing guarantees are required, such as real‑time control loops. 2) The algorithm adds negligible CPU overhead; the random number generation is cheap. 3) Ensure the backoff value is capped to avoid integer overflow or excessively long sleeps.
Efeito pragmático
Reduces load spikes on services, improves overall system stability, and prevents cascading failures during outages.
Dica de memória
Equal jitter backoff is like splitting a crowd: half wait a fixed time, the other half wait a random extra, so arrivals are staggered.
Nota
Choose a cryptographically secure RNG only when security matters; otherwise, the standard pseudo‑random generator is sufficient.
Upgrade path
Implement decorrelated jitter backoff for even lower synchronization risk
Log in to save chunks.