Skip to content
4xx · client errorSent by Proxy | App | CDN

429Too Many Requests

You have sent more requests than allowed in a period of time. Slow down and try later.

How you get a 429

This client has already used its allowance for the current minute. The proxy's rate limiter counts one request too many and the proxy sends 429 with Retry-After. The app is spared the work.

Who sends itProxy · App · CDN

  1. Browser
  2. CDN
  3. Proxy
  4. App
  5. DB

Typically the proxy or API gateway, which counts requests per client before they reach the app. The app sends it for limits it tracks by itself, such as a per-account quota.

In short

What a 429 Too Many Requests means

A 429 Too Many Requests means a rate limiter decided this client has used up its allowance for now. The request was not processed, and nothing is wrong with it apart from its timing. The limit is typically enforced by a proxy, API gateway or CDN that counts requests per IP address or API key before they reach the application; the application sends 429 for quotas it tracks by itself. The response can include a Retry-After header saying how long to wait, and many APIs add headers showing the limit and how much of it remains. The right reaction is to wait at least that long and then continue more slowly. Retrying immediately, or in a tight loop, only uses up the next window as well.

Common causes of a 429

  1. 1A client loops or retries without waiting.

    How to check: Count requests per second from one key or address in the access log, just before the first 429.

  2. 2Many users share one IP address, such as an office or a mobile carrier, and hit a per-address limit together.

    How to check: The 429s come from one address with many different sessions behind it.

  3. 3A third-party API's quota for your key is exhausted.

    How to check: Read the rate limit headers on the response.

    curl -sI https://api.example.com/v1/items | grep -iE 'retry-after|ratelimit'
  4. 4A crawler or script is fetching pages faster than the site allows.

    How to check: Group the access log by user agent.

Retry or not?

Safe to retry with backoff · After Retry-After

The request was not processed, so repeating it is safe. Wait at least as long as Retry-After says, or back off exponentially with jitter if the header is missing, and lower your request rate.

Headers that matter

Retry-After
How long to wait, in seconds or as a date. Optional, but honour it when present.
RateLimit-* / X-RateLimit-*
Not part of the core standard. Widely used to show the limit, what remains, and when the window resets.

In the real world

RFC vs real deployments

RFC 6585 defines 429 and leaves open how clients are identified and counted. Not every limiter uses it. nginx's request limiter answers 503 unless told otherwise, and GitHub's API uses 403 for some of its rate limits. The RFC also notes that a server under attack need not answer at all; dropping connections costs it less than sending 429s.

Seen in a real outage

A rate limit protects a service from its own popularity. In March 2020 Robinhood went down at market open on a record day, in what its founders called a thundering herd of requests.

Your turn

Which code is it?

A script gets 429 with “Retry-After: 30” from an API. It retries every second, and after a minute every single call is still failing. Why?

429 questions

Who sends a 429?
Typically a proxy, API gateway or CDN that counts requests per client. The application sends it for quotas it tracks by itself, such as a monthly plan limit.
How long should I wait after a 429?
As long as the Retry-After header says. If there is none, wait and double the delay after each failed attempt, with some randomness.
What is the difference between 429 and 503?
A 429 is about you: this client sent too much. A 503 is about the server: it cannot take requests from anyone right now.

Sources: RFC 6585: 429 Too Many Requests (section 4) ↗ · RFC 9110: Retry-After (section 10.2.3) ↗ · nginx: limit_req_status ↗ · GitHub: Rate limits for the REST API ↗ · Report a problem

Diagrams are our own simulations. All wording is original and paraphrases the linked sources.

Practise this in the DNS / HTTP track

Two-minute animated lessons, then boss fights from real outages. Free, no account needed.

Start the track