Log inStart free
LESSON 33.14 · 6 STAGES · 2 CONTROLS · 2 CHECKSPRO · PREVIEW

Load shedding

A flood of large requests overloads the GPUs, and the gateway decides what to drop.


Pro lesson. Stage 1 is free to watch. Pro opens all 6 stages, 2 controls and 2 checks, in this lesson and every other.

Go Pro · $8.25/mo
EXPLAINER · 33.14 · GATEWAY BAY10–20 S: 30,176 TOKENS/S · CAPACITY 6,000
01
Stage 1 of 6 · Overload
From 10 s to 20 s, the requests ask for 30,176 tokens a second. The 4 replicas serve 6,000.
Explain it simply

Each bar in the lanes is one request, and a taller bar is more work. The bars at the bottom add up the work that arrives in each second. The ochre line is what the replicas can do. While the flood runs, the work that arrives is about 5 times that line.

Three lanes of request bars on a 30 second axis. Below them, the work per second. From 10 to 20 seconds it is about 30,176 tokens a second, over the capacity line at 6,000.

requestscapacity, limitsanswered in timelate (filled), shed (outline)wait ahead
051015202530 sK1chat app15R25K2batch job12K3flood40capacity 6,000 tokens/swork a second0–40,000 tokenstraffic against capacityload ρ = 30,176 / 6,000 = 5.03 from 10 s to 20 sρ > 1: the work ahead grows every second051015202530 sK1chat app15R25K2batch job12K3flood40capacity 6,000 tokens/swork a second0–40,000 tokenstraffic against capacityload ρ = 30,176 / 6,000 = 5.03 from 10 s to 20 sρ > 1: the work ahead grows every second
Toy: 3 API keys, 67 requests in 30 s, no rate limit
STAGE 1 / 6
MATH · STAGE 1HOVER A SYMBOL OR A SHAPE
ρ=λμ\sy{rho}{out}{\rho} = \dfrac{\sy{lam}{data}{\lambda}}{\sy{mu}{param}{\mu}}
ρ=30,1766,000=5.03>1\rho = \frac{30{,}176}{6{,}000} = 5.03 > 1

The load is the work that arrives over the work the replicas finish.

Common mix-ups

MYTHLoad shedding only drops the flooding client's requests.

The fix, and 1 more mix-up with the diagram to show them, come with Pro.

Predict, then reveal
2 CHECKS · PRO
Q01With 4 replicas and a 20 s wait limit, does admission control stop late answers?

Make your guess, then test it in the diagram. All 2 checks come with Pro.

PRO LESSON · YOU WATCHED STAGE 1 OF 6
Unlock the full explainer
  • 5 more stages and 2 live controls
  • 2 mix-up cards and 2 predict-then-reveal checks
  • Watch it as a narrated video, in three voices
  • Every Pro lesson and capstone · 656 in total

$99 a year, or $15 a month. Cancel any time.