Bot Rate Limit Calculator: Cloudflare, Nginx limit_req and HAProxy
Converts one request limit into settings for three platforms.
Use the tool
Why this tool exists
Each platform expresses a rate limit differently: Nginx wants rate=30r/m and a zone size, HAProxy wants a stick table that tracks the request rate over a period, and Cloudflare wants a count, a period and a mitigation time.
Enter the limit, the burst and the number of clients and get the three settings, with the memory sizing rule from the Nginx documentation. Allowed periods in Cloudflare depend on your plan, so check them.
How to use it
- Enter requests and the period.
- Set burst and the number of clients.
- Copy the settings you need.
- Test with a load tool before you enforce.
Frequently asked questions
Why does Nginx convert my hourly limit?
limit_req only supports per second and per minute.
What is burst?
Extra requests allowed above the rate before limiting starts.
How big should the zone be?
About 16,000 client states per megabyte, so the tool rounds up.
Behind a CDN?
Key on the real client IP header, not the proxy.