The Desi Architect
Notes / Docker Sandboxes / Timeouts, Retries, Exponential Backoff & Toxiproxy
Docker Sandboxes · Tier 1: Building Blocks · Lab 12

Timeouts, Retries, Exponential Backoff & Toxiproxy

Make a network slow on purpose and watch what your code does. See why a missing timeout holds every caller, how a retry rescues a short blip, how retries with no waiting multiply an outage by four, and how backoff, jitter and a retry budget stop that.

Time40 minutes
StackToxiproxyPorts 18474, 18082
MemoryAbout 50 MB
Before thisLab 03HTTP Caching Headers & DNS Resolut
Verified runWindows, Mac, LinuxBash and PowerShell
  1. 1PrepareWhat you will learn
  2. 2PredictGuess before you run
  3. 3RunStep by step
  4. 4ObserveWhat you should see
  5. 5Break itChange one thing
  6. 6Clean upLeave nothing running
On this page
  1. 00 / What You Will Learn
  2. 01 / Why It Matters
  3. 02 / What We Are Building
  4. 03 / Words You Need
  5. 04 / Predict First
  6. 05 / Step by Step
  7. 06 / What You Should See
  8. 07 / Look Inside
  9. 08 / Break It, Fix It
  10. 09 / In Real Projects
  11. 10 / Interview Corner
  12. 11 / Clean Up

00 /What You Will Learn

By the end you will be able to
  • Explain what a timeout protects, and show a missing one holding callers.
  • Show that a retry rescues a short blip.
  • Reproduce a retry storm and measure the amplification.
  • Explain exponential backoff, jitter and a retry budget, and see each one work.
  • Use Toxiproxy to inject a fault between two services.

Before you start

Finish Lab 03 (HTTP, Caching and DNS) and Lab 09 (Latency and Percentiles) first. You should know what a request, a response and a timeout are, and what a percentile means. You do not need to know Toxiproxy.