
Agent Native Load Balancer for MCP Servers
Distributed agents hitting your APIs in bursts is a different traffic shape than what most rate limiters were built for — a burst of retries can look identical to a real spike, and by the time you've added enough headroom to survive it, you're paying for capacity you don't need the other 99% of the time. EZThrottle Local is a self-hosted, agent-native load balancer built on the BEAM: it queues incoming requests durably (Mnesia, disc_copies — survives a crash, not just a graceful restart), dispatches them at a rate your backend actually controls via response headers (so a backend under pressure can slow EZThrottle down in real time, no redeploy), and spreads dispatch across a pool of registered backend instances with reputation-weighted load balancing — a member that starts failing gets its share throttled down automatically instead of getting evicted on one bad response. Per-tenant fairness comes for free too: each tenant gets its own lightweight, independently-scheduled process instead of a shared queue, so a noisy tenant can't starve everyone else. On identical 512MB Fly.io hardware, that process-per-request model holds 100% success up to 800 req/s versus a ~400 req/s real ceiling on the Go/SQLite version — roughly double, and it traces directly to SQLite's single-connection/WAL serialization point, which Mnesia's per-process model just doesn't have.
It's open source (https://github.com/rjpruitt16/ezthrottle-local, benchmarks in benchmark.md), and I'd genuinely like feedback from people who've fought this class of problem on the BEAM before. One honest caveat if you're evaluating it: I also maintain a Go port (https://github.com/rjpruitt16/aquifer) that compiles to a single static binary — convenient if you want to drop it anywhere without a BEAM release, and still solid up to a few hundred req/s. If cross-compilation matters more to you than squeezing out the last bit of throughput, that's the one to look at instead.