Explore our new Cybersecurity Terms Glossary, explained by our experts.

View the Glossary View the Glossary
PRIVIA

Cybersecurity Terms Glossary

What Is Rate Limiting?

Rate limiting caps how many requests a client may make in a period, protecting authentication, APIs, and expensive operations from abuse and from accidental overload.

Illustration for the cybersecurity term Rate Limiting
Home / Blog / Cybersecurity Terms / What Is Rate Limiting?
17 November 2026

What Is Rate Limiting?

What Is Rate Limiting?

Rate limiting is the control that decides how many times a client may do something within a period. It is the difference between an attacker testing ten passwords and testing ten million, between a scraper copying a page and copying a catalogue, and between an expensive report endpoint serving its users and taking the database down. It is also one of the easiest controls to implement in a way that looks right and provides almost nothing.

Choosing an Algorithm

AlgorithmBehaviourTrade-off
Fixed windowCounter reset on a clock boundarySimple, but allows a double burst across the boundary
Sliding windowCounts the trailing period continuouslyAccurate, costs more state
Token bucketTokens refill at a steady rate, bucket has a capPermits a controlled burst, the usual API choice
Leaky bucketRequests queued and drained at a fixed rateSmooths traffic, adds latency

The fixed window weakness is worth understanding before choosing it. With a limit of 100 per minute, a client can send 100 at 10:00:59 and another 100 at 10:01:00, so the real short-term limit is double the stated one. Token bucket is the most common answer for public APIs because it tolerates legitimate bursts while holding the average.

What to Count, and Against Whom

Keying by IP address alone is the standard mistake. Mobile networks and corporate proxies put thousands of users behind one address, so a limit tight enough to matter blocks real people, and an attacker with a residential proxy pool defeats it regardless. Layer the keys instead: by authenticated account, by API key, by the identifier being acted on, such as the target username in a login attempt, and by network address as the coarsest and least trusted of the four.

Counting requests is also too crude for some endpoints. A GraphQL or report query may cost a thousand times more than a simple read, which is why weighted or cost-based limits exist, as discussed in GraphQL security.

The Bypasses Testers Try First

Responding Well

Return HTTP 429 with a Retry-After header so well-behaved clients back off correctly, and publish the current limit and remaining quota in response headers. For authentication specifically, the NCSC’s guidance for system owners recommends throttling attempts rather than locking accounts, precisely because lockout hands attackers a denial of service against your users. Increasing delays, combined with a CAPTCHA or step-up authentication after a threshold, keeps genuine users moving while making automation uneconomic.

Log every limit breach with the key that triggered it. A sudden rise in 429 responses is one of the clearer early indicators of an attack in progress, and without the key you cannot tell a broken integration from an adversary.

Where to Enforce It

Edge enforcement at a CDN or API gateway absorbs volume before it reaches your infrastructure and is the right place for coarse protection. Application enforcement understands identity, cost, and business rules, and is the right place for anything that matters. Most environments need both, with the application treating the edge as an optimisation rather than a guarantee. Distributed deployments need shared state, usually an atomic counter in Redis, or each instance enforces its own limit and the effective total is multiplied by the number of instances. Rate limiting is a standard check in our web application security testing, where the question is rarely whether a limit exists and almost always how it is keyed.

FAQ – Frequently Asked Questions

What Is a Reasonable Limit for a Login Endpoint?

There is no universal figure, but a few attempts per minute per account combined with a looser per-address limit suits most consumer applications. Pair it with increasing delays rather than a hard lockout, and add a challenge after a threshold. Measure your genuine users first: the limit should sit well above normal behaviour, including people who mistype passwords repeatedly.

Is Rate Limiting the Same as DDoS Protection?

No. Rate limiting is applied per client by your application or gateway and protects against abuse of specific functions. Distributed denial of service defence operates at the network edge, absorbing volumetric traffic from many sources before it reaches you. A rate limiter cannot help when the link itself is saturated, and a scrubbing service cannot tell that one account is testing passwords.

Should We Lock Accounts After Failed Logins?

Usually not. Lockout turns a guessing attempt into a denial of service against your own users, since anyone who knows a username can lock it. The NCSC recommends throttling instead, with increasing delays and monitoring. Where lockout is required by policy, make it temporary and automatic rather than requiring a support call to clear.

How Do We Rate Limit Across Multiple Servers?

Keep the counter in shared storage and update it atomically, typically with an increment-and-expire operation in Redis or a sliding window implemented in a short script. Without shared state, each instance enforces the limit independently and the effective limit becomes the configured value multiplied by the number of instances, which is rarely what anyone intended.

Related Terms

You May Be Interested In These

What Are Windows Event Logs?

Cybersecurity Terms

17 November 2026

What Are Windows Event Logs?

Read More
What Is Dirty COW?

Cybersecurity Terms

17 November 2026

What Is Dirty COW?

Read More
What Is Wireless Penetration Testing?

Cybersecurity Terms

17 November 2026

What Is Wireless Penetration Testing?

Read More