topics / traffic-routing
Rate Limiter
Fixed window, sliding window, token bucket and leaky bucket throttling, keyed per client. Hammer one caller to see it kick in — then flood from thousands of spoofed IPs to see where per-client limiting alone stops helping.
Every term this topic uses, defined once. Anywhere you see a word with a dotted underline — on Simulate or Study — hovering (or tapping, on touch) shows the same definition inline; this page is just the full list in one place.
Limiting algorithms
Fixed window
Counts requests in a fixed-size time slot (e.g. per minute) and resets to zero when the window rolls over. Simple and cheap, but bursty right at the boundary — a client can send a full window's worth of requests right before a reset and another full window's worth right after.
Sliding window
Counts requests in a trailing window that moves continuously with the current time, instead of resetting on a fixed clock tick. Fixes the fixed-window's boundary-burst problem, at the cost of tracking individual request timestamps.
Token bucket
Each client has a bucket of tokens, refilled continuously up to a capacity; every request spends one token. Refilling continuously (rather than resetting all at once) is what lets it absorb a short burst up to the bucket's capacity, then settle into the steady refill rate.
Leaky bucket
Requests fill a bucket that drains continuously at a fixed rate; a request that would overflow the bucket is rejected. Unlike token bucket, it smooths the rate the backend actually sees — bursts get queued and released steadily rather than passed straight through.
Burst
A short spike of requests arriving faster than the sustained rate. How well a limiter tolerates a burst — versus rejecting it outright — is one of the main things that actually separates these algorithms.
Refill / leak rate
How fast a token bucket refills, or a leaky bucket drains — the sustained requests-per-second rate the limiter settles into once any burst capacity is used up.
Server-wide (global) limiter
A second limit applied across every client combined, sitting after the per-client limiter. Protects the server itself from being overwhelmed by many clients each individually staying under their own limit.
Outcomes
Limited (429)
Rejected by the per-client rate limiter — this one client alone exceeded its own allowance.
Throttled (429, global)
Passed the per-client limiter fine, but rejected by the server-wide limiter because combined traffic from all clients exceeded the server's total capacity.
Overloaded (503)
Passed every rate limiter but got dropped anyway because the API itself was saturated — rate limiting controls how much traffic gets through, not how much the backend can actually handle once it does.
Blocked (network layer)
Never became an HTTP request in the first place — stopped at the network/protocol layer (SYN flood, UDP amplification) before a rate limiter, which only sees HTTP requests, ever had a chance to look at it.
Attacks
Slowloris
An attack that opens many connections but never finishes sending a request. A request-counting rate limiter has nothing to count — the attack ties up raw connection slots instead of tripping any request limit.
SYN flood
Sends TCP handshake-initiation packets and never completes the handshake, exhausting connection resources before an HTTP request ever exists. Handled below the application layer — SYN cookies, firewalls — not by a rate limiter.
UDP amplification
Sends small spoofed UDP requests to third-party servers that reply with much larger responses aimed at the victim — pure volumetric traffic with no HTTP request involved at all. Needs edge/CDN-level scrubbing, not a rate limiter.