Skip to main content

Keep your API fast—even at peak

Rate limiting and admission checks that help reduce overload and protect expensive work.

Reliable at peak

Set admission budgets for launch spikes and promos before excess work reaches your handlers.

Lower cloud costs

Fewer moving parts to run and monitor. Spend less on Redis and ops.

Dev‑first adoption

Add via SDK. Keep your stack. Clear limits your customers understand.

UNDERSTAND OVERLOAD · KEEP USEFUL WORK MOVING

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.

Course map Lesson 2 of 27 Browse all lessons

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.

  1. 01 A useful result starts with one request
  2. 02 Unfinished work grows when arrivals outrun completions You are here
  3. 03 More waiting space does not make work finish faster
  4. 04 A timeout ends waiting, not necessarily the work
  5. 05 Retained work can exhaust a process’s memory
  6. 06 One failed copy can push its neighbors over capacity
  7. 07 Refuse new work while the application can still recover
  8. 08 Different compute platforms still have finite resources
  9. 09 A shared database failure can spread back into every app
  10. 10 Restore capacity before restoring full traffic
  11. 11 A circuit breaker stops repeating a failing call

Contain one customer's excess without punishing everyone.

  1. 12 One customer’s excess should not ruin another’s day
  2. 13 A rate limit checks one customer’s recent allowance
  3. 14 Copies and languages must share the same intended policy
  4. 15 Fairness helps contain damage without reserving every resource
  5. 16 A legitimate crowd can exceed shared capacity

Reduce work entering a shared dependency when it slows.

  1. 17 Measure the operation whose pressure you want to observe
  2. 18 A shared tracker observes; a guard decides; your app acts
  3. 19 Even the fastest recent observations can become slow
  4. 20 Separate local histories can reopen into the same burst
  5. 21 Replace optional expensive work before refusing essential work
  6. 22 A local breaker learns after calls have already piled up
  7. 23 Fast errors explain why the protections remain complementary
  8. 24 Latency feedback helps without measuring exact spare capacity

Choose, combine, and test the right protections.

  1. 25 Ask three different questions before expensive work
  2. 26 Recovery attempts need limits too
  3. 27 Measure useful service, not how much work you accepted

Read the explanation or use the course map above. Audio is optional.

2 / 27

Unfinished work grows when arrivals outrun completions

Arrivals → completions → unfinished work

RequestsApplicationReportsAccepting ≠ finishingPeople need completed reports, not just accepted requests.RequestsApplicationReportsAccepting ≠ finishingPeople need completedreports, not just acceptedrequests.
  1. Incoming demand People request reports

    Acceptance is not completion.

  2. Useful output Reports actually finish

    Finite processing capacity serves the shared demand.

Worked illustration: equal-cost reports, initially empty, no refusals or cancellations. Blocks compare rates; tiles count unfinished work. Final charts compare two explicit demand patterns on identical linear time scales.

Read the numbered steps in order. The explanation below follows the narration.

Capacity is what can finish; throughput is what does finish.

100 arrivals/s − 80 completions/s = 20 extra unfinished requests/s.

0:00
Read transcript & diagram walkthrough

What you will learn

100 arrivals/s − 80 completions/s = 20 extra unfinished requests/s.

Now many people ask for reports. Capacity means how much work the system can finish in a given time under the conditions we are considering. Throughput is how much actually finishes.

For a simple worked example, assume every report costs the same amount of work. One hundred requests arrive each second, but only eighty finish. After one second, twenty remain unfinished. After ten seconds, two hundred remain, assuming none were refused or canceled.

This unfinished work is called work in flight. It includes work waiting to start and work already running. Latency is how long a particular operation takes from its chosen start to its finish. More waiting can make that time longer.

Would accepting another hundred requests make the eighty-per-second worker faster? No. A short burst may clear when arrivals fall. If arrivals stay above completions, unfinished work keeps growing until capacity, demand, or the work we accept changes.

Diagram walkthrough
  1. Many people depend on the same finite finishing capacity.

    Requests can arrive from many people at once. Accepting those requests and producing useful reports are different events; more accepted requests do not themselves make reports finish faster.

  2. Capacity is what the system can finish under these conditions.

    Capacity describes available finishing ability per unit of time. The request mix, available resources, and other conditions matter; it is not simply the number of requests the system can accept.

  3. Throughput is what actually finishes.

    Compare the two definitions. Capacity is the available ability to finish work; throughput counts actual completions. A system can finish less than its capacity, for example when less work arrives.

  4. Keep the cost of each report equal for this example.

    The following arithmetic assumes equal-cost reports and constant conditions. It starts with no unfinished work and retains everything that has not finished; real mixed-cost traffic need not behave this simply.

  5. Count arrivals first: 100 requests every second.

    This is offered demand, not completed reports. We need the finishing rate as well before we can work out whether unfinished work accumulates.

  6. 100 arrive while only 80 finish each second.

    Subtract completions from arrivals: 100 minus 80 leaves 20 extra unfinished requests each second. The finishing rate remains 80/s even though more work was accepted.

  7. After one second, one tile of work remains unfinished.

    Starting empty, 100 arrivals minus 80 completions leaves 20 unfinished requests. One tile represents those twenty requests; it is a count of work, not a memory allocation or a new processing slot.

  8. After ten seconds, ten of the same tiles remain.

    The same excess of 20/s continues for ten seconds: 200 requests remain unfinished. No request was refused or canceled in this calculation. The worker has still been finishing 80/s throughout.

  9. Work in flight includes both waiting and running work.

    Unfinished does not mean only requests sitting in a queue. It also includes operations already running whose required result has not completed. Both categories count as work in flight.

  10. Latency measures one operation across a chosen boundary.

    Choose a start and finish for the operation being measured. Time spent waiting within that boundary contributes to latency alongside time spent running; the unfinished count is not itself a duration.

  11. Accepting more work does not increase the finishing rate.

    The worker still finishes eighty reports each second in these conditions. Accepting more demand increases the unfinished work unless something else changes; acceptance alone is not extra capacity.

  12. A temporary burst can clear when arrivals fall enough.

    Read the rate chart first, then the unfinished-work chart. In this illustration, 100/s arrive for five seconds, then 60/s; 80/s keep finishing. Work grows to 100, then drains to zero: less must arrive than finishes before the old work can clear.

  13. Sustained excess keeps adding unfinished work.

    Same time window, same scales, same 80/s finishing rate. Dashed A falls to 60/s and clears. Solid B stays at 100/s: 20 extra requests each second leave 200 unfinished after ten seconds. Under unchanged conditions, waiting longer makes this case worse.

Content revision: 07c7dd00db17

Download review copy (27 lessons)
Check your understanding & apply it

How many extra requests remain after ten seconds?

Show the explained answer

200, under the equal-cost, constant-capacity assumptions with no refusal or cancellation.

Integration guidance

Measure arrivals, useful completions and unfinished work separately.

Where the promise stops

These illustrative rates assume equal-cost work and constant capacity; they are not product benchmarks.

Technical depth & sources

Concepts used here

Implementation detail

Request rate alone is a weak capacity proxy when work mix, resource costs or available capacity change.

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.

ElevenLabs

Why teams choose us

Happier customers
Consistent response times when it matters most.
Faster delivery
Ship features, not DIY limiters and brittle ops workarounds.
Clear controls
Per‑tenant and per‑route limits your stakeholders can reason about.

Engineering blog

View all posts →

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.

Auto-Scaling Won’t Save You

The myth of infinite serverless scale — why adding machines doesn’t fix overload, and what to do instead.