Free and Open Source Tools for Building a Rate Limiter
We get asked fairly often what we actually reach for when building rate limiting into a client's API, versus what we'd recommend a small team stand up on their own without hiring anyone or bringing in outside help. Here's the honest list, all free or open source, roughly in the order we'd typically bring them into a new project.
1. Redis
Redis is the backbone of most distributed rate limiters we've built, and for good reason. Its atomic increment operations make it straightforward to safely track per-client request counts across multiple application servers without race conditions producing an incorrect count, and it's fast enough that the added latency from checking it on every request is rarely noticeable. If you're only going to add one piece of infrastructure specifically for rate limiting, this is usually it.
2. Nginx
Nginx has rate limiting built into its core module set, letting you enforce a coarse limit at the gateway layer before requests ever reach your application code. This matters more than it might sound like, since a flood of rejected requests handled at the gateway never competes with legitimate traffic for your application server's database connections or worker threads. We often layer this under a finer-grained, business-aware limit implemented in the application itself.
3. Envoy
For teams running a service mesh or wanting more sophisticated traffic management than Nginx's built-in module offers, Envoy includes a dedicated rate limiting filter designed to work with an external rate limit service, which decouples the limiting logic from the proxy itself and makes it easier to share consistent limits across multiple services rather than configuring each proxy independently.
4. Kong
Kong is an API gateway built specifically around plugin-based request handling, and its rate limiting plugin is one of the more commonly deployed pieces of its open source offering. If you're already running an API gateway for other reasons, authentication, request transformation, adding rate limiting through the same layer avoids standing up yet another separate piece of infrastructure just for this one concern.
5. k6
Building a rate limiter is only half the job; testing it properly under realistic bursty traffic is the other half, and it's the half teams skip most often. k6 supports scripting arbitrary request timing patterns rather than just constant-rate load, which makes it meaningfully better suited to testing rate limiter burst behavior than tools built primarily around steady-state load generation.
6. The IETF's RateLimit Header Fields Draft
Not a tool exactly, but worth knowing about: there's an ongoing IETF effort to standardize the response headers APIs use to communicate rate limit status, remaining capacity, reset time, and so on. Following a proposed standard rather than inventing your own header naming convention makes your API easier for client libraries and tooling built around the emerging convention to work with automatically.
7. Traefik
Traefik is another open source reverse proxy and load balancer, popular in container and Kubernetes-heavy environments, with rate limiting available as one of its built-in middleware options. If your infrastructure is already containerized and you're picking a proxy layer from scratch, Traefik's rate limiting configuration integrates naturally with the same dynamic service discovery it uses for routing, which can be simpler to manage than a static configuration file in environments where services are constantly scaling up and down.
8. HAProxy
HAProxy has been a standard load balancer for a long time, and its stick-table feature can be used to implement rate limiting by tracking request counts per client IP or other identifiers directly at the load balancer layer. It's a heavier lift to configure correctly than some of the more purpose-built API gateway options on this list, but it's battle-tested at serious scale and worth considering if your infrastructure already relies on it for load balancing and you'd rather not introduce a separate tool just for rate limiting.
How These Tools Actually Fit Together in a Real Stack
In practice, most of the rate limiting setups we build combine two or three of these rather than relying on just one. A typical pattern: Nginx or Traefik at the edge enforcing a coarse limit to absorb obvious floods before they reach application servers, Redis as the shared counter backing both the edge enforcement and any finer-grained application-level limits, and k6 in the CI pipeline running load tests against realistic bursty traffic patterns before any rate limiting change ships to production. Envoy, Kong, and HAProxy tend to enter the picture once an organization already has one of them in place for other reasons, load balancing, service mesh routing, and it makes more sense to add rate limiting to existing infrastructure than to introduce a new tool solely for this purpose.
What We'd Actually Recommend for a Small Team
If you're a small team standing this up for the first time without dedicated infrastructure headcount, start with Redis for the shared counter and either application-level logic or Nginx's built-in module for enforcement, depending on whether you need business-aware limits (different limits per subscription tier, for instance) or just a flat technical ceiling. Envoy and Kong are worth reaching for once you're running enough distinct services that centralizing rate limiting logic outside individual applications starts paying for itself, which for most teams is later than they initially expect.
None of these tools solve the actual design decisions on their own, choosing token bucket versus sliding window, sizing limits so legitimate bursts don't get needlessly rejected, deciding whether to enforce per-client, per-endpoint, or both, and deciding how failures in the shared store itself should be handled. We wrote up our full thinking on those design questions in How to Design a Rate Limiter That Doesn't Punish Legitimate Bursts, which pairs naturally with whichever tools from this list you end up standing up.
Where Managed Services Fit In
Everything above is self-hosted, which is deliberate since this list is specifically about free and open source options a team can run themselves. It's worth acknowledging that managed API gateway and rate limiting services exist too, and for teams without the operational appetite to run and monitor Redis or a proxy layer themselves, a managed option can trade cost for reduced operational burden. We tend to recommend starting with the open source stack described here for most clients, since the actual operational overhead of running Redis and a proxy is smaller than it's often assumed to be, but it's a legitimate tradeoff worth evaluating against your team's actual infrastructure capacity rather than assuming self-hosted is automatically the right call for every situation.
The Honest Caveat
Every tool on this list is free to use and genuinely solid, but "free" doesn't mean "zero effort to run correctly." Redis needs monitoring and a redundancy plan of its own, Envoy and Kong both have real learning curves before a team is confident configuring them correctly, and even Nginx's rate limiting module has enough configuration nuance (burst parameters, delay behavior) that a naive first attempt often behaves differently than intended. 137Foundry helps teams get past that first-attempt gap when the tooling is right but the configuration around it needs an experienced set of eyes on it.

















