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 09 · From Scratch · Distributed Scheduler · with code: Go · about 21 min to read

Play it as a journeyTutor comes with a plan

Scheduler 05: Dispatch Queue

Dispatch Queue
Dispatch Queue · Open board

From the Distributed Scheduler series, sitting under the project lesson Build Your Own Distributed Scheduler, From Scratch. Follows Scheduler 04: Leader Election, which narrowed a fleet of schedulers down to exactly one allowed to decide, and hands off to Scheduler 06: Idempotency and Fencing.

Before you start. This lesson is part of a series that builds a small copy of a job scheduler: a program that runs other programs at the exact right time, the way a nightly backup needs to happen without a person watching a clock. The last lesson gave the series exactly one decider: several copies of the scheduler compete for a time-limited claim called a lease, and only the current holder may decide what’s due right now. This lesson asks what that decider should do once it has decided something, and why the answer isn’t “run it yourself.”

Lesson 66 of 117 in From Scratch

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

  • 2009: GitHub’s site got slow, and it wasn’t traffic
  • The fix: a queue for the decision, workers for the work
  • Midnight: nothing happens, then everything does
  • The concurrency limit: the dial that isn’t how many workers you hired
  • Retrying without everyone retrying together
  • The dead-letter queue: giving up, on purpose
  • At-least-once: delivered twice, completed once

Terms it explains: what, when, queue, workers, not, concurrency limit, jitter, dead-letter queue, at-least-once, oldest-waiting-job age, in-flight against the cap, depth, pinned at the cap, below, from each other, 1000, 1000, 1000, 1000, 116, 68, 39, 21, transient, deterministic, window, before, confirmation was lost, Delete the jitter, Set `MaxAttempts` to 100, On a real queue, Sidekiq: Error Handling, SQS, visibility timeout, dead-letter queues.

Review From Scratch