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.
Failure-detection delay
Basic timeout-only breaker
Memory remains occupied
Failure detection has a delay
Illustrative mechanism. Highlight follows the explanation; not a benchmark.
Read the numbered steps in order. The explanation below follows the narration.
At 0–30 s, overlapping callers can wait before the first timeout becomes observable.
Observe the detection delay: calls already in flight keep consuming resources before a basic timeout-only breaker opens.
Observe the detection delay: calls already in flight keep consuming resources before a basic timeout-only breaker opens.
Now the suggestions service stops answering. Consider a basic breaker that counts only completed timeouts, each with a thirty-second deadline. For almost thirty seconds, calls can overlap before the first timeout is known. Their waiting state retains memory. Opening the breaker does not erase calls already in flight.
If two hundred application copies each require three observed failures, that is six hundred threshold observations, provided every copy reaches its threshold in the window. It is not a cap on failed calls. A new copy with no history can repeat discovery. A shared circuit breaker can reduce this duplication too.
Consider a different case: the dependency slows down but still answers successfully. A shared latency guard can refuse new work once its eligible signal reaches the configured threshold, before a failure-only breaker has a timeout to count. Modern slow-call breakers can also respond before complete failure.
RateLimitly's benefit is shared latency evidence for admission, not advance knowledge of every outage. If a sudden failure produces no fresh signal, do not assume immediate protection. Bound waiting and retained work, and show a cheap fallback when possible.
A failure-only detector cannot count an outcome that has not arrived. Many calls can overlap before the first 30-second timeout is observed.
Derived example: 200 copies × 3 observations = 600 threshold observations if every copy reaches its threshold. That is not a cap on total failed calls.
Gradual successful slowdown is different from a sudden silent outage. Latency-based admission can act on slow observations; modern slow-call breakers can too.
Without fresh evidence, do not assume immediate refusal. Bound waiting and retained work independently of the detector.
Content revision: 07c7dd00db17
Download review copy (27 lessons)Are six hundred threshold observations a maximum of six hundred failed requests?
No. The arithmetic assumes all two hundred copies reach three observed failures. Overlapping calls, new copies and probes can add more failures.
Load-test abrupt stalls and gradual slowdown separately. Share the intended observation scope, bound concurrency and keep a fallback path.
Shared evidence has freshness and routing boundaries. Shared breakers exist; low-latency shared admission is not an instantaneous outage oracle.
Start here. No earlier lesson is required.
240 requests/s ÷ 3 = 80 each; after one loss, 240 ÷ 2 = 120 each.
Closed permits calls; open refuses them; half-open tests recovery with bounded probes.
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.
Detection delay, admitted concurrency and cancellation determine retained work before a trip. Test new replicas without history and delayed observations.
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.