← All work

Work · 2025

Fluxgate

A rate limiter that holds two million requests a second on three small nodes.

RoleLead engineer
WhereAcme Pay
Year2025
StackRust, Redis, gRPC
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

  1. 01Moved counters to the edge, one per node, and synced them in the background instead of on every request.
  2. 02Wrote the hot path in Rust with a token bucket in plain memory, no locks on the read side.
  3. 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

Screenshots

Next caseLattice →