Work · 2025
Fluxgate
A rate limiter that holds two million requests a second on three small nodes.
2M
The problem
The old limiter was a shared counter in a database. Under a traffic spike it became the slowest part of the payment path, and it failed open, so abusive clients got through exactly when load was highest.
The approach
- 01Moved counters to the edge, one per node, and synced them in the background instead of on every request.
- 02Wrote the hot path in Rust with a token bucket in plain memory, no locks on the read side.
- 03Added a replay tool that ran a week of real traffic against the new limiter before a single customer saw it.
The outcome
- 2Mrequests a second on 3 nodes
- 0.3msadded to the p99
- -80%infrastructure cost