Expand description
Cross-instance reconciliation of the fleet-wide limit view via a shared store.
The request path never touches the store. It reads a cached estimate of what
the rest of the fleet has consumed for a key (updated by the background
task) plus this instance’s own count, and gates on that. A background task
pushes this instance’s deltas (INCRBY) and pulls the aggregate (MGET) on
an interval, so a store outage degrades to per-instance limiting rather than
failing requests.
Counts are held in a sliding window (see super::window) so the fleet gate
has no boundary burst. The worst-case fleet overshoot is bounded by one sync
interval of the other instances’ traffic, about
(N-1) * rate * (interval / window) requests (interval and window in the
same unit).
Structs§
- Global
Counters - Cross-instance counter reconciliation over a shared Redis-protocol store.