IT Glossary
What is rate limiting (request rate limiting) and how does it work?
The rule by which a system caps how many requests it accepts from one client in a given period, so that it stays stable for everybody; on excess it usually answers with HTTP 429.
- 7
- sections
- 4
- questions answered
Rate limiting is the rule by which a server caps how many requests it accepts from the same client in a time interval — for example 1,000 per minute — and refuses the extra ones, usually with the HTTP status 429 Too Many Requests. The “client” is identified by IP address, account or API key, and the limit can apply to the whole server, to one route or to one user; the choice belongs to the server (RFC 6585, section 4). A real Romanian example: the ANAF API (api.anaf.ro, used for e-Factura and e-Transport) accepts 1,000 calls per minute and answers 429 above that (ANAF application registration procedure, 17.10.2024).
Without a limit, a looping script, a careless partner or a scraper can absorb every resource while legitimate customers find the door closed. For a company, request limiting is both a shield and a commercial instrument: it protects servers from surprise bills and cascading outages, discourages bulk extraction of data from your site and makes differentiated packages possible — for example, a free customer gets a hundred requests an hour and a premium one ten thousand. The OWASP API Security Top 10 (2023) lists missing limits as API4:2023, “Unrestricted Resource Consumption”, with the risk of outages and unexpected bills (cloud, SMS paid per call). A public API without limits is an invitation to abuse.
Why it matters for your business
Stability for every customer
One consumer running out of control — a looping script, an attack — can no longer bring the service down for everybody else; the damage stays isolated at its source.
Predictable infrastructure costs
A request ceiling puts a natural bound on resource consumption — the cloud bill can no longer explode overnight because of traffic you never wanted (OWASP API4:2023 also asks for spending limits at providers).
The foundation of commercial API tiers
Different limits per plan turn an API into a sellable product, with a clear upgrade argument for customers whose usage keeps growing.
How rate limiting works
The server identifies the client (IP address, account or API key), counts its requests in a time window and compares the count with the cap. Under the cap the request passes; above it the server either refuses it (usually with 429) or slows it down and queues it.
That is the difference between the two terms: limiting refuses what exceeds the cap, while throttling slows or delays requests. In nginx, for example, the limit_req directive with the burst parameter queues excess requests, and nodelay serves them immediately. The rule can run in the application, in the web server (nginx), in an API gateway or at CDN and proxy level, as Cloudflare does.
The 429 code and the Retry-After header
The 429 Too Many Requests status is defined in RFC 6585, section 4 (April 2012): the user has sent too many requests in a given amount of time. The response should explain the condition and may include a Retry-After header. RFC 6585 does not say how to count requests or how to identify the client, and a 429 response must not be stored by a cache.
Retry-After is defined in RFC 9110, section 10.2.3 (June 2022, STD 97) and holds either a number of seconds (Retry-After: 120 means 2 minutes) or an HTTP date. The X-RateLimit-Limit and X-RateLimit-Remaining headers are a widespread but non-standard convention. The IETF is working on RateLimit-Policy and RateLimit (draft-ietf-httpapi-ratelimit-headers-11, 23 May 2026), still an Internet-Draft on 18 November 2026.
Not every server answers 429: nginx refuses with 503 by default (the limit_req_status setting), so a correct client handles both codes. Checked on 18 November 2026 at rfc-editor.org, datatracker.ietf.org and nginx.org.
Want an estimate for your project?
Message us on WhatsApp. We reply the same working day, and the first 30-minute call is free.
Algorithms: fixed window, sliding window, token bucket, leaky bucket
Fixed window: a counter reset at fixed intervals, for example 100 requests per minute. It is the simplest, but at the window boundary a client can send up to double the limit within seconds (100 at 09:00:59 and another 100 at 09:01:00). Sliding window: always counts the requests of the last N seconds, so there is no boundary spike, at the cost of more memory.
Token bucket: a bucket fills with tokens at a fixed rate, each request consumes one token, and the bucket capacity is the permitted burst. Amazon API Gateway uses token bucket: “rate” is tokens per second, “burst” is the bucket capacity, and the client may receive 429. Leaky bucket: requests enter a queue that drains at a constant rate; nginx limit_req uses this method.
For a company’s APIs, token bucket is usually the right choice, because it accepts short legitimate bursts.
Limits you meet in practice
ANAF (api.anaf.ro) answers 429 when the call limit is exceeded, and the 17.10.2024 procedure states 1,000 requests per minute; limits may be adjusted in future, separately per service. An e-Factura integration that sends or downloads in bursts must therefore slow down and retry. Amazon API Gateway applies limits per account and Region, plus per-method limits in usage plans.
The rule for the client: on 429, wait as long as Retry-After says; if it is missing, retry with growing pauses (exponential backoff).
For a company: where to put limits and what they do not solve
Start from the measured consumption of a legitimate client, add a margin and adjust from statistics: a limit too tight frustrates partners, one too loose protects nothing. Set stricter limits on login, “forgot password” and SMS OTP requests, where OWASP describes the scenario of abuse through SMS paid per call.
Rate limiting does not stop a massive distributed attack: each source stays under the limit, and defence happens at network level. Limits should also appear in monitoring, so you see who hits them and how often.
Frequently asked questions
What does the 429 Too Many Requests error mean?
You exceeded the server’s request limit within an interval (RFC 6585). The response may include a Retry-After header, with seconds or a date; a correct integration waits and retries automatically, without losing data.
What is the difference between rate limiting and throttling?
Limiting refuses requests above the cap, usually with 429, while throttling slows them down or queues them. Many products use both terms for the same mechanism: AWS calls “throttling” a system that answers with 429.
Token bucket or fixed window: which algorithm should you choose?
Token bucket for APIs with legitimate bursts; fixed window when you want the simplest counter and accept the boundary spike; sliding window when the boundary spike matters. For a company’s APIs, token bucket is usually the right choice.
Does rate limiting stop DDoS attacks?
Only partially: it stops application-level abuse from individual sources, but a massively distributed attack is fought at network level, with specialist services such as Cloudflare or AWS Shield. The two protections complement each other, they do not replace each other.
Let’s talk about your project
Book a free 30-minute call or send us an email. We reply the same working day.
office@northdan.com · +40 750 252 851