Formula: Exponential Backoff Systems Engineering Formula
- baseDelayMs: Base Delay (ms)
- backoffMultiplier: Backoff Multiplier (×)
- maxAttemptsCount: Max Attempts Count (retries)
- maxDelayCapMs: Max Delay Cap (ms)
Plan API client retry budgets using t_i = min(Cap, Base × Factor^i).
6.4 s is only the last wait. The window adds every wait: 0.2, 0.4, 0.8, 1.6, 3.2 and 6.4 s, which sum to 12.6 s. With a multiplier of 2, the total is always just under twice the final delay until the cap engages, so the last retry alone accounts for about half the waiting.
No. It is pure sleep time between attempts. Add the time each of the seven requests can take to fail, which depends on your connect and read timeouts. A request that hangs until a long timeout can dominate the total far more than the backoff schedule does, so check both when setting a deadline.
Each wait is drawn uniformly between zero and its capped delay, so each one averages half its deterministic value. Adding the halves gives half the cumulative total. For the default that is 6.3 s. It is an expected value across many runs; any single run can land anywhere between nearly zero and the full 12.6 s.
Every retry waits exactly the base delay. Six retries at 200 ms give a 1.2 s window and a 0.6 s jitter mean. That is constant backoff, which is simple but gives a struggling service little relief. It suits quick local retries, such as a lock that is usually released within milliseconds.
A cap smaller than the first wait would clip every retry to the same value, so the multiplier would do nothing and the schedule would be constant backoff in disguise. The engine treats that as an input mistake. If you want very short, equal waits, set the multiplier to 1 instead; six retries at 200 ms then give a 1.2 s window.
It is the most common choice, because it grows fast enough to ease load and stays easy to reason about. A larger multiplier such as 3 reaches the cap sooner; with the default base and cap, six retries at 3x total 28 s. A smaller one, such as 1.5, keeps waits short for longer and suits latency-sensitive calls.
Enough to ride out a brief blip, not so many that a real outage keeps clients busy for minutes. The default six fits a short window of about 12.6 s. Raising it to ten, with the 10 s cap, stretches the window to 52.6 s. For user-facing requests, three to five retries is common; background jobs can tolerate more.
Usually yes. The first retry is where synchronized clients collide most, because they all failed at the same moment. Applying full jitter from the first wait spreads them out immediately. This calculator's mean assumes jitter on every retry, which is why it is exactly half the deterministic total.
No. It stops each individual wait from growing beyond the cap, but every extra retry still adds the full cap to the window. At 8 retries the default gives 32.6 s and at 10 it gives 52.6 s, growing by 10 s per extra retry. To bound the total, limit the retry count or set an overall deadline.
Its sixth wait is 9,600 ms, just under the 10000 ms cap. Any small increase in base or retries would make the cap start clipping delays. It is a good illustration of a schedule on the edge, where further growth in the total becomes linear instead of exponential.
Use the cumulative worst case, 12.6 s in the default, plus the time each attempt can take to fail. Jitter never makes the total longer than the deterministic schedule, so the worst case is a safe ceiling. The 6.3 s full jitter mean is better for estimating typical latency or how much retry traffic a downstream service will see during a short incident.
Yes, every wait is 60% of the default's matching wait, because the base scales the whole schedule. The six waits total 7.56 s instead of 12.6 s and the last is 3,840 ms. The trade-off is that early retries arrive sooner, which helps with brief blips but gives an overloaded service less time to recover.
The default describes a client that waits 200 ms before its first retry, doubles the wait each time, gives up after 6 retries and never waits longer than 10000 ms between attempts.
Written out in seconds, the six waits are 0.2, 0.4, 0.8, 1.6, 3.2 and 6.4. Add them and you get 12.6 s, the cumulative worst-case retry window at the top of the result. The supporting lines show the same thing in milliseconds: the final attempt waits 6,400 ms, and the total is 12,600 ms.
None of the six waits reaches the cap. The sixth would need to exceed 10 s, and 6.4 s does not, so the cap is idle in the default.
The window is the time spent sleeping between attempts. It is not the time until the client gives up. Each attempt also takes time to fail, whether that is a fast connection refusal or a full request timeout, and that time is added on top. A client with a 5 s timeout making seven attempts could spend another 35 s waiting on responses beyond the 12.6 s of backoff.
Without a cap, the delays form a geometric series. The formula on the page is Delay_i = min(Cap, Base x Multiplier^(i minus 1)), so retry 1 waits the base, retry 2 waits base times the multiplier, and so on.
For a multiplier of 2 the uncapped sum has a neat shortcut: it equals the base times (2 to the power n, minus 1). With n = 6 that is 200 ms times 63, which is 12,600 ms. It also means the total is always just under twice the last delay. Here the last delay is 6.4 s and the total is 12.6 s.
That rule of thumb matters for budgeting. With doubling, half of all the waiting happens in the final retry. Adding one more retry roughly doubles the total window, as long as the cap has not kicked in.
For other multipliers the uncapped sum is base times (m^n minus 1) divided by (m minus 1). A multiplier of 1 is the special case where every wait is just the base, so six retries at 200 ms add up to 1.2 s. The engine handles that correctly.
The cap turns exponential growth into a straight line. Once the computed delay passes the cap, each further retry adds exactly the cap to the total.
Raise the default to 8 retries and the seventh delay would be 12.8 s, so it is clamped to 10 s, and the eighth is clamped too. The engine reports a 32.6 s window: the first six retries' 12.6 s plus two capped waits of 10 s each. At 10 retries the window is 52.6 s, four capped waits on top of the same base.
Lowering the cap changes earlier delays. With the default six retries and a 5 s cap, the sixth wait drops from 6.4 s to 5 s and the window becomes 11.2 s.
The multiplier interacts with the cap quickly. At 3x, the delays run 0.2, 0.6, 1.8 and 5.4 s, then the fifth would be 16.2 s and is cut to 10 s, as is the sixth. The engine gives 28 s in total.
One guard applies here: the cap cannot be lower than the base delay. Enter a cap smaller than the 200 ms base and the engine asks you to check the inputs instead of producing a schedule, because a cap under the first wait would make every delay identical and the multiplier pointless.
Deterministic backoff has a known failure mode. If a thousand clients all fail at the same moment, they all retry at 200 ms, then all again 0.6 s after the start, and so on. The server sees synchronized waves of traffic exactly when it is weakest.
Jitter spreads those waves out. With full jitter, each wait is a random value chosen uniformly between zero and the capped delay for that retry. The sixth retry, instead of always waiting 6.4 s, waits anything from 0 to 6.4 s.
A uniform draw between zero and d has an average of d divided by two. Since every retry is halved on average, the expected total is half the deterministic total. That is the 6.3 s mean shown under the default, and the 0.5 x CumulativeDelay formula on the page.
The worst case is unchanged. On a very unlucky run every random draw lands near its maximum and the client waits close to the full 12.6 s. So size your timeouts and user-facing deadlines on the cumulative figure, and use the mean for capacity estimates and typical latency.
Full jitter is not the only scheme in common use. Equal jitter keeps half of each delay fixed and randomizes the other half. A retry with a capped delay d waits d/2 plus a random value between zero and d/2.
The range for each wait is therefore d/2 to d, and the average is three quarters of d. For the default, the expected total under equal jitter is 0.75 times 12.6 s, or 9.45 s, while the worst case stays at 12.6 s. The minimum total is 6.3 s, because each wait is at least half its deterministic value.
Equal jitter guarantees that a client never retries almost instantly, which some teams prefer when the downstream service needs at least some breathing room. Full jitter spreads load more evenly and finishes sooner on average, at the cost of occasionally retrying after only a few milliseconds.
The calculator only reports the full jitter mean. If you use equal jitter, multiply the cumulative figure by 0.75 yourself. Decorrelated jitter, where each wait depends on the previous random wait, has no simple closed form and is better checked by simulation.
Max Attempts Count is labelled in retries, and the engine treats it as the number of waits. Six retries means seven total requests: the original call plus six more. If your library's setting counts total attempts including the first, enter one less than that number.
Some libraries apply the base delay before the second request and multiply from there, which matches this engine. Others multiply first, so their first wait is already base times multiplier. Check which convention yours uses, or the window will be off by a full factor of the multiplier.
Units matter. The base and the cap are in milliseconds. Typing 2 for a two-second base gives a 2 ms base and a window measured in tenths of a second.
A cap set lower than the base is rejected, as described above. A cap far above the largest delay the retry count can reach does nothing at all, so it is worth checking whether yours ever engages.
Finally, the window ignores any Retry-After header from the server. If the service tells clients exactly how long to wait, that value usually overrides the backoff schedule.
The three base-delay scenarios scale the whole schedule in proportion. At a 120 ms base the six waits add up to 7.56 s, with a final wait of 3,840 ms and a 3.78 s jitter mean. At 300 ms the total is 18.9 s, the last wait is 9,600 ms, and the jitter mean is 9.45 s.
Notice that the 300 ms case's final wait sits just under the 10 s cap. One more retry, or a slightly larger base, and the cap would start clipping. That is a useful signal: if your schedule's last delay is close to the cap, the cap is about to become the main thing controlling your total.
A practical way to size a client is to start from the deadline. Suppose a user-facing request should give up within 20 s. Subtract the time each attempt can take to fail, then pick a base and retry count whose cumulative window fits the rest. The 300 ms preset already uses 18.9 s on waiting alone, which leaves almost nothing for the requests themselves.
For background jobs the constraint is usually server load rather than a deadline. There the full jitter mean is the more useful number, because it predicts how retries from many clients will actually spread out.
Backoff limits how often a single client retries. It does not limit how many clients are retrying. During a real outage, thousands of clients each following the 12.6 s default schedule still multiply the load on a struggling service by up to seven times the normal request rate.
Two things help beyond the schedule itself. A retry budget caps retries as a share of total traffic, so when most calls are failing, the client stops retrying and fails fast. A circuit breaker stops sending requests at all for a while after repeated failures.
Retries also only make sense for errors that might go away. Timeouts, connection resets and service unavailable responses are good candidates. Validation errors and authorization failures will fail the same way every time, so retrying them just burns the window.
Finally, retried requests must be safe to repeat. A payment or an order that is not idempotent can be applied twice if the first attempt succeeded but its response was lost.