---
title: "What is exponential backoff?"
url: https://proxy.wiki/glossary/exponential-backoff/
type: Glossary Term
author: "proxy.wiki editorial"
published: 2026-09-06
updated: 2026-10-21
site: proxy.wiki
topics: ["Web scraping"]
license: CC BY 4.0; quote freely with attribution to https://proxy.wiki/
---

# What is exponential backoff?

> Exponential backoff is a retry policy in which the wait before each new attempt grows by a fixed factor, usually doubling, up to a ceiling.

Doubling the wait is the part everyone remembers and the part that matters least. A policy that survives production has four pieces, and the one doing the most work is randomness.

```
delay = min(cap, base * 2 ** attempt)   # growth, with a ceiling
delay = random.uniform(0, delay)        # jitter
if attempt == max_attempts: give_up()   # termination
# and if the server sent Retry-After, wait that long instead
```

## Why the jitter matters more than the doubling

Twenty workers that fail at the same moment and follow the same schedule wake at the same moment. Their retries arrive together and can rebuild the very burst that caused the failure. Marc Brooker’s analysis on the AWS Architecture Blog compared jittered and unjittered backoff under contention and concluded that jitter should be the standard approach for remote clients. The variant he calls full jitter, used above, picks a uniformly random wait between zero and the capped delay.

We reproduced the effect in a small simulation with Python 3.15.0: 20 workers fail at time zero, base delay 1 second, ceiling 60 seconds, five retry rounds, random seed 42. The table counts the retries that land inside the busiest 100 ms window of each round.

_Retries landing in the busiest 100 ms window per round, 20 workers, one seeded simulation_

| Retry round | No jitter | Full jitter |
| --- | --- | --- |
| 1 | 20 | 5 |
| 2 | 20 | 3 |
| 3 | 20 | 2 |
| 4 | 20 | 3 |
| 5 | 20 | 1 |

Without jitter every retry of every round hits the target in the same instant. With it, the worst window held five. That is one seed, so read the shape rather than the exact counts.

## What Python’s requests actually does

Out of the box, nothing. In requests 2.32.3 the adapter’s `DEFAULT_RETRIES` is 0, so a failed request fails once and returns. Retries come from urllib3’s `Retry` class, mounted on a session. We read urllib3 2.3.0’s source and ran it to see the real schedule:

- With `backoff_factor=0.5` the waits were 0, 1, 2, 4, 8, 16, 32 and 64 seconds. The first retry is immediate. After that the wait is the factor times 2 raised to the number of consecutive failures minus one.

- The ceiling is `DEFAULT_BACKOFF_MAX`, 120 seconds.

- Jitter is off unless you set `backoff_jitter`, and it is added on top of the computed wait rather than replacing it.

- On 413, 429 and 503 responses that carry [Retry-After](/glossary/retry-after/), the server’s value replaces the schedule. Against a local server answering 429 with `Retry-After: 3`, urllib3 waited 3.01 and 3.00 seconds where its own schedule said 0 and 1.

```
import requests
from requests.adapters import HTTPAdapter
from urllib3.util.retry import Retry

retry = Retry(
    total=5,
    backoff_factor=0.5,          # waits 0, 1, 2, 4, 8 s between attempts
    backoff_jitter=1.0,          # adds 0 to 1 s at random to each wait
    status_forcelist=[502, 503, 504],
    allowed_methods=["GET", "HEAD"],
)                                # 413, 429 and 503 with Retry-After obey the server
session = requests.Session()
session.mount("http://", HTTPAdapter(max_retries=retry))
session.mount("https://", HTTPAdapter(max_retries=retry))
```

A hand-written loop for httpx, with the same two rules, is in [retries that do not make things worse](/guides/proxies-in-python-requests-httpx/#retries-that-do-not-make-things-worse). The version tuned for 429 responses through a proxy is in [backoff that does not resynchronise](/guides/403-vs-407-vs-429/#backoff-that-does-not-resynchronise).

## Where the idea comes from

TCP did it first. RFC 6298 tells a host to set the retransmission timeout to twice its previous value after each timeout, in its own words to “back off the timer”, and allows a maximum provided it is at least 60 seconds. Every HTTP retry policy runs on top of a transport that is already backing off underneath it.

## When backoff is the wrong tool

Backoff answers transient failure: a reset connection, a timeout, a 503 during a deploy. It does nothing for a 403, which is a refusal and needs something to change, or for a CAPTCHA page, which is a classification and gets worse with persistence. It also cannot fix a steady request rate that the target will not accept. Above that line, backoff produces a slow oscillation around the limit and a poor [success rate](/glossary/success-rate/); the cure is a lower rate set in advance, covered under [rate limiting](/glossary/rate-limiting/). An agent with a person waiting on the answer needs a tighter bound still, as argued in [bounded retries, because someone is waiting](/guides/proxies-for-ai-agents/#bounded-retries-because-someone-is-waiting).

## Frequently asked questions

### Does Python's requests retry failed requests by default?

No. In requests 2.32.3 the default is zero retries. You get backoff only by mounting an HTTPAdapter with a urllib3 Retry object, and jitter only if you also set backoff_jitter.

### How many retries should I allow?

Enough to ride out a transient fault, few enough that a persistent one is reported instead of hidden. Cap both the attempt count and the delay. An uncapped loop turns one failing target into a load generator and spends bandwidth on requests that cannot succeed.

### Should I back off on a 403?

No. A 403 is a refusal, and repeating the same request on a longer schedule gets the same answer. Change something first: the address, the client, the session or the rate.

## Sources

1. [Marc Brooker, AWS Architecture Blog: Exponential Backoff and Jitter](https://aws.amazon.com/blogs/architecture/exponential-backoff-and-jitter/)
2. [RFC 6298: computing TCP's retransmission timer, doubling on timeout and the 60-second floor for any maximum](https://www.rfc-editor.org/rfc/rfc6298.html)
3. [urllib3 documentation: the Retry class, backoff_factor, backoff_jitter and Retry-After handling](https://urllib3.readthedocs.io/en/stable/reference/urllib3.util.html)
