The four architectures
How does each scheduler architecture protect cluster state, and why do two random probes go so far?
| Architecture | Concurrency-control analogue | What it gives up |
|---|---|---|
| Monolithic (one scheduler, global view) | single lock | scheduler throughput; extensibility |
| Two-level offers (a resource manager offers resources to per-framework schedulers) | pessimistic locking | a global view: frameworks see only a subset, so cross-framework preemption and packing are impossible, and gangs must hoard offers |
| Shared-state optimistic (many schedulers work on a copy of the cluster state, commit with CAS) | MVCC + CAS retry | wasted work under conflict. The conflict rate rises with gang size and with resource scarcity |
| Distributed sampling (each scheduler probes a few random machines) | no coordination | global constraints, fairness and gangs. It buys near-optimal placement from the power of two choices |
The surprise: sampling needs only two probes
Sampling works for a counterintuitive reason: probing two random nodes and taking the one with the shorter queue gives an exponentially better tail than probing one, and probing all of them barely improves on two (the power of two choices). So most of the value of a global view can be obtained from a sample of size 2. That is why a scheduler can skip coordination entirely and still place well: it gives up only what needs the global view (constraints, fairness, gangs).
Contested, honestly: does the monolithic scheduler really not scale?
The "monolithic schedulers do not scale" claim is more cited than demonstrated. Google's monolithic Borg scheduler ran production clusters at scale for years. The shared-state work was motivated as much by extensibility (letting different teams add scheduling policies without editing one codebase) as by throughput.
Treat "centralized schedulers do not scale" as organizational reality more than physical law. Lena should measure her own decisions-per-second need before she redesigns anything.
The cluster state is a shared object. Pick pessimistic, optimistic or sampled, and pay the same prices you would pay in a database.