How exponential backoff works
After each failed attempt, the client waits before trying again, and each wait is longer than the last: the base delay times the multiplier to the power of the retry number, up to a cap. With a 500 ms base and a multiplier of 2, that's 500 ms, 1 s, 2 s, 4 s and so on. The growing gaps give an overloaded or rate-limited server room to recover instead of being hit again straight away.
Why add jitter
If many clients fail at the same moment (a deploy, a brief outage), plain exponential backoff makes them all retry at the same moments too, in synchronized waves. Jitter randomizes each wait so the retries spread out. AWS's write-up Exponential Backoff and Jitter compares the strategies in this calculator:
- Full jitter picks a random wait between 0 and the exponential value. It spreads load the most, but a wait can land very close to 0.
- Equal jitter keeps half the exponential value and randomizes the other half, so a retry never goes out sooner than half the planned wait.
- Decorrelated jitter picks a random wait between the base delay and three times the previous wait, capped.
Retry-After beats your own backoff
When a 429 or 503 response carries a Retry-After header, the server is telling you when to come back. Use that instead of your computed delay, and if it's longer than you're willing to wait, give up and report the error. Paste a value into the Retry-After parser to see how a client should read it, and check which status codes to retry at all.
Test the schedule, not just the formula
A unit test of the delay function won't catch a client that ignores Retry-After, retries a 422, or never gives up. Point your client at a Jitterbox endpoint that fails on purpose, and its resilience report checks the real timing of every retry. The guide How to test retry logic walks through it.