Log inStart free
LESSON 33.20 · 5 STAGES · 2 CONTROLS · 3 CHECKSPRO · PREVIEW

Why latency explodes near saturation

Watch latency climb slowly, then shoot up as the GPU nears full load.


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

Go Pro · $8.25/mo
EXPLAINER · 33.20 · QUEUE BAYρ 0.80 · MEAN LATENCY 0.65 S
01
Stage 1 of 5 · Latency per request
Each bar is one request's latency: the grey wait on top of the ochre service. At utilization ρ 0.80, the mean latency is 0.65 s.
Explain it simply

Each bar is one chat request, placed at the time it arrives. The ochre part is the time the GPU spends on it. The grey part on top is the time it waits in the queue first. The slowest one, R26, waits 1.62 seconds for 0.42 seconds of work.

Sixty bars along the arrival time. The mean latency is 0.65 s. The slowest request, R26, waits 1.62 s and takes 2.04 s in all.

servicewaitlatencyM/M/1
latency (s)arrival time (s)012345051015mean 0.65 sR26latency 2.04 swait 1.62 sservice 0.42 slatency per requestthe slowest requestR26: W = 1.62 + 0.42 = 2.04 slatency (s)arrival time (s)012345051015mean 0.65 sR26latency 2.04 swait 1.62 sservice 0.42 slatency per requestthe slowest requestR26: W = 1.62 + 0.42 = 2.04 s
Toy: 60 chat requests, one toy GPU, first come, first served
STAGE 1 / 5
MATH · STAGE 1HOVER A SYMBOL OR A SHAPE
Wi=Wq,i+Si\sy{w}{out}{W_i} = \sy{wq}{ink}{W_{q,i}} + \sy{s}{param}{S_i}
WR26=1.62+0.42=2.04 sW_{\text{R26}} = 1.62 + 0.42 = 2.04\ \text{s}

Latency is the wait in the queue plus the service time.

Common mix-ups

MYTHLatency grows in step with load.

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

Predict, then reveal
3 CHECKS · PRO
Q01At 20 ms per token, λ goes from 4 to 4.5 req/s. Which grows more: P50 or P99?

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

PRO LESSON · YOU WATCHED STAGE 1 OF 5
Unlock the full explainer
  • 4 more stages and 2 live controls
  • 2 mix-up cards and 3 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.