Apex › Transport & web

GCRA — rate limiting with a single timestamp

The Generic Cell Rate Algorithm: the rate limiter behind Redis-Cell and many API gateways, which does everything a token bucket does with just one number of state per client — a "theoretical arrival time." A request is allowed if it arrives no earlier than TAT − τ; if so the TAT jumps forward by T. Idle time banks burst; sending too fast pushes the TAT past your clock until you're throttled, and the gap is your exact Retry-After. Drag the cadence and watch the one-line state throttle the stream.

More in Transport & web