What a per-IP limiter actually keeps track of
limit_req module as a concrete case, since many hosting stacks use it or something built the same way. A typical setup looks like this:
NGINX
limit_req_zone $binary_remote_addr zone=perip:10m rate=10r/s;
server {
location / {
limit_req zone=perip burst=20 nodelay;
}
}$binary_remote_addr, which is the client address as raw bytes: 4 bytes for IPv4 and 16 bytes for IPv6. It then looks that key up in a shared memory zone that all nginx worker processes can see.
Each entry in that zone stores very little: when this key was last seen, and an excess counter. The algorithm is a leaky bucket. Every request adds one to the bucket, and the bucket drains at the configured rate, here 10 per second. If the excess goes past the burst value, nginx rejects the request, by default with a 503. Otherwise the request moves on to the content handler and becomes real work for the backend.
The important detail is that all of this state is kept per key. The limiter answers one question: is this particular address sending too fast? It has no idea how many requests arrived in total across all keys, and nothing in the design asks it to. A flood that is spread thin passes this check by design.
Why the numbers never trip the limit
What runs out while the limiter stays quiet
xmlrpc.php, or any URL with a random query string appended so the page cache treats each request as new.
Each of those requests goes through FastCGI to PHP-FPM. The PHP-FPM pool has a fixed number of workers. Once every worker is busy, new requests wait in the socket's listen backlog. When that wait exceeds nginx's timeouts, visitors start getting 502 and 504 errors. The database often reaches its connection limit around the same time. CPU and bandwidth graphs can look unremarkable during all of this, because the bottleneck is the worker count, not raw throughput.
This differs from slow-connection attacks, which hold sockets open without completing requests. That case is covered in the Slowloris article. A thin HTTP flood sends complete, valid requests, and each one is individually unremarkable.
Counting requests also misses a related trick that the credshields guide calls parameter splitting. Some APIs accept several queries or login attempts in one request body. If the limiter counts requests but ignores what each request contains, an attacker can pack many attempts into each one and stay under the limit even from a single address.
From the support desk, this case usually arrives as a complaint that the site is down while the firewall and rate limiter show nothing blocked. The first useful check is the shape of the traffic in the logs. Changing thresholds can wait until you know what you are dealing with.
Checking the spread in your access logs
BASH
# Requests per IP to one endpoint, busiest first
awk '7 ~ /^\/wp-login\.php/ {print1}' /var/log/nginx/access.log | sort | uniq -c | sort -rn | head -20
# Number of distinct IPs that hit that endpoint
awk '7 ~ /^\/wp-login\.php/ {print1}' /var/log/nginx/access.log | sort -u | wc -l
# Total requests to that endpoint per minute (logs are chronological, so no sort needed)
awk '7 ~ /^\/wp-login\.php/ {print substr(4, 2, 17)}' /var/log/nginx/access.log | uniq -c | tail -20Signals that see the whole flood
map that gives every login request the same key and gives every other request an empty key, which the limiter does not count:
NGINX
map urilogin_bucket {
default '';
/wp-login.php $server_name;
}
limit_req_zone $login_bucket zone=login_total:1m rate=20r/s;limit_req zone=login_total burst=40; to the location that handles the login page. The numbers here are illustrative. Base yours on the per-minute baseline from the log check. Be aware of the trade-off: once this limit trips, real users on that endpoint get rejected too. What you get in return is that the PHP-FPM pool and the database stay available, so the rest of the site keeps working. Many setups put a challenge on that endpoint when the limit trips instead of returning a hard 503. Whether that is possible depends on your WAF or CDN.
The second signal is session behavior, which the API rate limiting overview describes as behavioral and contextual limits. A real browser loads the HTML, then fetches CSS, JavaScript, and images. It sends back cookies it was given earlier, includes a Referer, and pauses between pages. Flood clients often go straight to one dynamic URL, ignore Set-Cookie, never request assets, and attach random query strings. A simple cookie check catches basic scripts: set a cookie on the first response and require it before serving expensive endpoints. Headless browsers will pass that check, but running a full browser for every request costs the attacker far more CPU and memory.
The third signal is the client fingerprint. During the TLS handshake, the client's ClientHello message lists its cipher suites, extensions, and their order. That list depends on the TLS library the client uses, not on the User-Agent header it chooses to send. JA3, and the newer JA4, turn those fields into a short fingerprint string. If a request claims to be Chrome but its TLS fingerprint matches a scripting library, the claim is inconsistent. More importantly, a botnet running one tool across thousands of IPs often shares a single fingerprint, and that fingerprint becomes a key you can rate-limit on. HTTP/2 settings and header order can serve the same purpose. Stock nginx does not compute these fingerprints, so check what your CDN, WAF, or modules actually expose before you plan around them.
Keep the per-IP limit, because it cheaply stops single noisy clients. But it should not be your only layer. Add at least one limit keyed on the thing you are protecting, such as the login or search endpoint. When the site slows down and nothing is being blocked, check the distinct-IP count and the per-minute totals before you touch the per-IP threshold. For the related problem of floods that look like normal browser traffic even to DDoS protection, see what passes as legitimate at Layer 7.