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

Load-balancing policies

Five load-balancing policies send the same 20 requests to 4 replicas.


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.12 · BALANCER BAY20 REQUESTS · 10 SHARED PROMPTS · 1 PER 250 MS
01
Stage 1 of 5 · Requests arrive
Twenty requests arrive, one every 250 ms. Ten share a 1,200-token system prompt, so their prompts are long.
Explain it simply

Each block on top is one request, placed at the time it arrives. A taller block has a longer prompt. The solid blocks share one long system prompt, the fixed instructions a chat bot puts first. So half of the requests bring most of the work: 13,766 of 16,800 tokens.

A strip of 20 request blocks, one every 250 ms. Ten tall solid blocks share the system prompt. Four empty lanes below, W1 to W4.

request, prefillwaitrouter signaldecode, first tokenslowest TTFT
012345678910time, sW1W2W3W4R16the requestsarrivalsshared promptplain promptR16 arrives at t = 250 × 15 = 3,750 ms012345678910time, sW1W2W3W4R16the requestsarrivalsshared promptplain promptR16 arrives at t = 250 × 15 = 3,750 ms
Toy: the 33.C2 traffic, 20 requests on 4 replicas
STAGE 1 / 5
MATH · STAGE 1HOVER A SYMBOL OR A SHAPE
ti=250 (i−1) ms\sy{t}{data}{t_i} = 250\,(i-1)\ \text{ms}
t16=250×15=3750 mst_{16} = 250 \times 15 = 3750\ \text{ms}

Request i arrives 250 ms after the one before it.

Common mix-ups

MYTHRound robin spreads the work evenly.

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

Predict, then reveal
3 CHECKS · PRO
Q01In mixed traffic, does token-aware routing raise or lower the worst time to first token?

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.