Redis is down. Does your rate limiter block every request?
transcript
Your rate limiter just took down your whole API. The thing built to protect it. Here's how it happens.
Assume 150,000 requests a second at peak. Every single one asks Redis first: is this client over its limit? And it must answer in under 2 milliseconds.
Then Redis becomes unreachable. 150,000 requests a second, and nobody can say yes. What now?
For ordinary API limits, fail open. Allow the request, log it, alert. A limiter outage must not become an API outage. Fail closed only where letting extra through is dangerous. Logins. OTP sends. Expensive jobs. Even then, don't reject everything. Fall back to a strict local limit per gateway.
But here's the catch. Redis doesn't always die. Sometimes it just gets slow. Waiting 200 milliseconds on every request? Worse than letting one through. So give the call a timeout of a few milliseconds. And treat a timeout like an outage.
The limiter guards the API. It must never be its single point of failure. Fail open. Time out fast. Fail closed only where it's dangerous.
Full breakdown in the lecture.