Why you shouldn’t use Redis as a rate limiter: Part 1 of 2
A tour of the common Redis-based rate limiter implementations — and the correctness and performance traps each one hides.
We can't find the internet
Attempting to reconnect
Something went wrong!
Hang in there while we get back on track
Rate limiting and admission checks that help reduce overload and protect expensive work.
Set admission budgets for launch spikes and promos before excess work reaches your handlers.
Fewer moving parts to run and monitor. Spend less on Redis and ops.
Add via SDK. Keep your stack. Clear limits your customers understand.
UNDERSTAND OVERLOAD · KEEP USEFUL WORK MOVING
For developers, architects, and managers: 27 narrated lessons on why services overload and how to protect them. No cloud experience required. Start with one request, or jump to any lesson.
Four chapters, one learning path. Read or listen in any order. ~41 minutes total · Times shown at 1×.
Keep enough capacity to finish work and recover.
Contain one customer's excess without punishing everyone.
Reduce work entering a shared dependency when it slows.
Choose, combine, and test the right protections.
Read the explanation or use the course map above. Audio is optional.
One call, two observations
Time taken.
Not a usable suggestion.
5 ms and 500 ms are illustrative, not recommended settings. Duration and failure classification are separate signals; refusal decisions occur before later work.
Read the numbered steps in order. The explanation below follows the narration.
A quick answer can still be an error: measure duration and useful outcome separately.
Low latency does not prove success. Rate limits, latency guards, error-aware breakers and local bounds observe different problems.
Low latency does not prove success. Rate limits, latency guards, error-aware breakers and local bounds observe different problems.
A service can fail quickly. Suppose the suggestions service returns an error in five milliseconds. That is a failed result with low latency, not an overloaded queue we have measured.
With a five-hundred-millisecond guard, a five-millisecond observation is below the threshold. RateLimitly's latency report carries a duration, not an HTTP success or failure classification. A latency guard alone therefore does not replace an error-aware circuit breaker.
An error-aware breaker can count those failures and open. Half-open can later restrict recovery probes. By contrast, insufficient or expired tracker history produces a zero signal in the current implementation. That is not proof of health, and it is not the same as a bounded recovery probe.
Choose protection by the question it answers. Is one tenant taking too much? Use its rate limit. Is shared work getting too slow? Use shared latency admission. Are operations failing? Consider an error-aware breaker. Is this application retaining too much work? Bound its local resources. Your application chooses the cheap alternative, whichever protection declines the expensive operation.
A call has both a duration and an outcome. Looking at only the duration loses the fact that the customer did not receive a usable result.
Keep these two facts attached to the same call. The short duration does not turn its failed result into success or prove that a queue is overloaded.
Five is below five hundred. This latency check alone may admit later work. The report protocol carries duration, not an HTTP success/failure classification.
Opening depends on its configured criteria and sufficient observations, not one universal number of failures. Low duration does not erase classified errors.
After the configured open wait, a bounded number of test calls can supply recovery evidence. Waiting alone does not repair the dependency.
The zero signal is optimistic behavior when insufficient history qualifies. It is not a measured five-millisecond result and not proof of health or a bounded half-open probe.
Tenant fairness, shared latency, classified errors, and local retained work answer different questions. Application code chooses a correct cheap alternative when protected work is declined.
Content revision: 07c7dd00db17
Download review copy (27 lessons)Will a 500 ms latency guard necessarily reject a service returning errors in 5 ms?
No. Five milliseconds is below that latency threshold. Classify errors separately; keep an error-aware breaker when the failure pattern needs one.
Record both duration and outcome without disguising an error as fabricated latency. Configure bounded recovery and cheap alternatives explicitly.
RateLimitly does not claim every circuit-breaker feature. Shared state and graceful fallback are possible with other designs too.
Start here. No earlier lesson is required.
Closed permits calls; open refuses them; half-open tests recovery with bounded probes.
The tracker observes; the guard decides; your application enforces the decision.
The eligible recent minimum is a pressure signal with freshness and missing-data limits.
Drop optional cost first, using a genuinely cheap and acceptable fallback.
The current latency-report protocol contains duration but no outcome field; an insufficient-history minimum of zero is optimistic admission, not a half-open state machine.
Original explanation inspired by Fred Hébert and operational references; no endorsement implied.
AI-generated narration: ElevenLabs Eleven v3, Daniel stock voice. Audio streams only when you start listening.
A tour of the common Redis-based rate limiter implementations — and the correctness and performance traps each one hides.
The myth of infinite serverless scale — why adding machines doesn’t fix overload, and what to do instead.