Index

Free, with Google

Keep going, free.

A free account opens lessons 2 and 3 of every track, 33 more lessons, and keeps your progress and review cards on every device.

Start free with Google

A chalk plan

Open everything on chalk.

Every lesson, board, video, lab and paper, and the full review decks. Yearly is $39/year.

See plansStart free instead

Module 07 · System Design · The stall, built · with code: Go · about 16 min to read

Watch: Queues: the order slip rail and the cliff
▶ VideoPlay it as a journeyTutor comes with a plan

The stall, built: rush hour (load testing, p99 and the knee in Go)

The Order Slip Rail
The Order Slip Rail · Open board

The rail of slips over the stove, and the chart where the wait leaves the ground as the stove gets busy. This lesson draws that chart again, from a real program, by sending it a crowd and timing every cup.

Before you start. The stall, built: copies and shards (replication and sharding in Go) finished the stall’s back room: a copy of the book that runs a few milliseconds behind, and the book cut into three by a hash. The front of the stall is still the one from The stall, built: one counter in code (load balancing, health checks and caching in Go): three stalls, each cooking one cup at a time, and a gate that sends each customer to the least busy one. Thirty stalls on one order (availability, the nines, and the tail at scale) said the number that matters is how slow the unlucky customers are, not the average one, and that an order split across many stalls meets its unluckiest stall far more often. The stall that turns people away (load shedding and admission control) showed that when orders arrive faster than the stoves cook, the line grows without end. This lesson measures both on the stall you built.

Lesson 43 of 115 in System Design

The rest of this lesson is part of a plan.

A plan opens every lesson, board, video, lab and paper on chalk. Yearly is $39/year.

See plansAlready a member? Sign in

Or start free: a free account opens lessons 2 and 3 of every track.

In this lesson

  • November 2014: the load generator that looked away
  • The stall on paper: 1,500 cups a second
  • A crowd on a schedule: the load generator
  • The middle customer and the unlucky one: p50 and p99
  • The knee: where the wait leaves the ground
  • The stove stops for 200 ms: coordinated omission
  • A stall shuts, and the other two are suddenly 90% busy

Terms it explains: coordinated omission, load generator, p50, p99, knee.

Lab

The kitchen is 95% busy. How much longer do you wait than at 50%?

Drag How busy the kitchen runs to 99%, then set Turn orders away to 10 slips and watch the wait fall.

Open The order slip rail

Related papers

Review System Design