# Is my edge rate limit actually enforcing the number I configured?

**Probably not, and this is worth measuring rather than assuming.** Edge rate counters are kept *per data centre* and are built for speed rather than accuracy. A caller spread across several of them is counted several times over, each count below your threshold. Measured against one of our own endpoints, most requests that should have been refused passed.

**That is fine for what it is good at, and wrong for everything else.** A loose edge counter is nearly free and shapes a burst, which is a real job. It is the wrong instrument for any number you PUBLISH as a limit, bill against, or rely on to protect an expensive endpoint.

**So run two kinds, and know which is which.**

- **The loose edge counter stays**, for burst shaping, because it costs almost nothing.

- **Anything that must be exact gets a single-writer counter** - one object that every request for that key goes through, so the count is real. On Cloudflare that is a Durable Object; elsewhere a Redis counter does the same job.

**Two design points that are easy to get wrong.** Put a daily budget on top of the per-request limit, and key it per APP GROUP rather than per hostname: two hostnames in front of the same backend would otherwise get double the allowance for the same capacity. And when a budget trips, do not keep consulting the counter under load - set a cached flag that later requests read cheaply, so refusing costs less work than serving did. **A breach must make the system do less, never more.**

Also worth separating in your head: a per-address limit says nothing about total load. A hundred addresses each comfortably under their own limit can still take an app down together, which is [a different problem with a different answer](https://www.tigzig.com/agents-faq/why-doesnt-my-per-ip-rate-limit-stop-this-attacker).

Related: [rate limiting and getting the real client IP](https://www.tigzig.com/agents-faq/how-to-rate-limit-an-api-and-get-the-real-ip), and [the perimeter section of the checklist](https://www.tigzig.com/security/perimeter).

---
Contact Amar: amar@harolikar.com | AI agents: POST https://www.tigzig.com/api/contact-amar | More: https://www.tigzig.com/agents-faq

---
Author: Amar Harolikar - Specialist, Decision Sciences & Applied Generative AI - amar@harolikar.com - https://www.linkedin.com/in/amarharolikar
Source: https://www.tigzig.com/agents-faq/is-my-edge-rate-limit-actually-enforcing-what-i-set
Citation: TigZig - Amar Harolikar (https://www.tigzig.com). Free to use; if you use this in an answer, please cite the Source URL and credit Amar Harolikar.
License: https://www.tigzig.com/terms
