Log inStart free
LESSON 23.09 · 5 STAGES · 3 CONTROLS · 3 CHECKSPRO · PREVIEW

Retries with backoff and jitter

Eight payments retry a flaky tool until waits, a timeout and jitter get them paid.


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

Go Pro · $8.25/mo
EXPLAINER · 23.09 · RETRY BAYPAID 3/8 · 8 CALLS · 4 BUSY · 1 WAITING
01
Stage 1 of 5 · One try
Eight payments call the tool at once. With one try, 3 are paid: 4 get busy, 1 never hears back.
Explain it simply

Each lane is one payment, and time runs to the right. The tool works on 4 calls at a time, so payments 5 to 8 get a busy reply. About 3 in 10 of the calls it takes fail. Payment 2's reply is lost, so its agent waits forever.

Eight lanes, one per payment. Payments 1, 3 and 4 end in a paid dot. Payments 5 to 8 end in a busy square after 20 ms. Payment 2 has no reply. 3 of 8 are paid.

callswaits and limitsfailurespaid and charged
0250500750100012501500mscapacity 4calls in workpayment 1$12paidpayment 2$40waitingpayment 3$7paidpayment 4$25paidpayment 5$60failedpayment 6$18failedpayment 7$33failedpayment 8$9failedcharged1 still waiting, never doneone tryp(fail) = 0.3 · capacity 40250500750100012501500mscapacity 4calls in workpayment 1$12paidpayment 2$40waitingpayment 3$7paidpayment 4$25paidpayment 5$60failedpayment 6$18failedpayment 7$33failedpayment 8$9failedcharged1 still waiting, never doneone tryp(fail) = 0.3 · capacity 4
Toy: 8 payments · a tool that fails 30% of calls and takes 4 at once
STAGE 1 / 5
MATH · STAGE 1HOVER A SYMBOL OR A SHAPE
pfail=0.3,capacity=4\sy{f}{grad}{p_{\text{fail}}} = 0.3,\quad \sy{c}{param}{\text{capacity}} = 4
paid=3 of 8, busy=4\text{paid} = 3\text{ of }8,\ \text{busy} = 4

Three calls in ten fail, and the tool takes 4 at once.

Common mix-ups

MYTHMore retries at once always raise the success rate.

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

Predict, then reveal
3 CHECKS · PRO
Q01With a 200 ms timeout, are more or fewer paid at the jitter stage?

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 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.