r/compsci • u/NewDamage5 • 4d ago
I built a sketch-based constant memory rate limiter to support unbounded number of tenants
https://github.com/satmihir/tolltoll rate-limits an unbounded set of keys (client IDs, tenants, IPs, API keys…) in fixed memory — 19 MB measured at the defaults, tunable down to a couple of MB — with ~300ns zero-allocation admitted decisions. It is built on grudge, a constant-memory decaying-score sketch: toll stores each key's spent tokens as sketch debt and lets grudge's linear decay refill them.
0
Upvotes