Jitter
Jitter is a small random variation added to a computed delay, most often the delay between retry attempts, so that independent clients do not all wake up and act at exactly the same instant.
Without jitter, every client that failed at the same moment, for example right after a dependency restarted or a deploy finished, recomputes the same exponential backoff delay and retries in lockstep, producing repeated bursts of load known as a thundering herd or retry storm; each burst can itself trigger new failures, which are then retried in a new burst, and so on. Adding randomness spreads those retries out over time and decorrelates the clients from one another.
Several jitter strategies exist, trading off predictability for effectiveness at spreading load: full jitter picks the delay as a random value between 0 and the full computed backoff, for example rand(0, base * 2 ** attempt), which is simple and effective at breaking synchronization, at the cost of some retries firing sooner than the backoff alone would suggest; equal jitter keeps half of the computed backoff fixed and randomizes only the other half, guaranteeing a minimum delay while still adding randomness; and decorrelated jitter randomizes each delay based on the previous delay rather than solely on the attempt count, further reducing correlation across many retrying clients.
Jitter is typically added by hand around usleep() or sleep() calls, using random_int() for the random component, or provided by retry libraries and by Guzzle/Laravel retry middleware that accept a delay callback.
<?php
// Full jitter: sleep = rand(0, base * 2^attempt)
function jitteredDelayMs(int $attempt, int $baseMs = 250): int {
return random_int(0, $baseMs * (2 ** $attempt));
}
usleep(jitteredDelayMs($attempt) * 1000);
?>