Log inStart free
LESSON 29.12 · 6 STAGES · 3 CONTROLS · 3 CHECKSPRO · PREVIEW

Percentiles and tail latency

Sort 100 request latencies into a staircase and read P50, P99 and the tail.


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

Go Pro · $8.25/mo
EXPLAINER · 29.12 · LATENCY BAY100 REQUESTS · 4 SLOTS · 60 WAITED
01
Stage 1 of 6 · Requests arrive
100 requests share 4 slots. 60 wait in the queue for a free slot.
Explain it simply

Each thin bar is one request, in the order it arrives. The brick part is time spent waiting for a free slot, and the teal part is the server's work. The 5 long teal bars are long replies, and each one holds a slot for over 18 seconds.

100 bars on an arrival-time axis, one per request. 60 bars start with a brick wait part.

queue waitrun timepercentiles, pages
arrival time (s)firstlast0501001502004 slots60 waited5 long replies100 requests by arrival, 4 slotsarrival time (s)firstlast0501001502004 slots60 waited5 long replies100 requests by arrival, 4 slots
Toy: 100 requests on a 4-slot server, seeded arrivals
STAGE 1 / 6
MATH · STAGE 1HOVER A SYMBOL OR A SHAPE
ti=wi+si\sy{t}{out}{t_i} = \sy{w}{grad}{w_i} + \sy{s}{data}{s_i}
t98=10.83+4.63=15.46 st_{98} = 10.83 + 4.63 = 15.46\,\text{s}

Latency is the queue wait plus the run time, shown for the longest wait.

Common mix-ups

MYTHThe mean latency shows how slow the slow requests are.

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

Predict, then reveal
3 CHECKS · PRO
Q01With long replies, if the load drops to light, which falls more: P50 or P90?

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

PRO LESSON · YOU WATCHED STAGE 1 OF 6
Unlock the full explainer
  • 5 more stages and 3 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.