Skip to content
About
Main content

Summary and key takeaways

The one sentence. Scheduling is the management of a under unknown job durations. It conserves work and only relocates delay. So admission, not ordering, is the real control.

The three questions

  • When (job and task scheduling): the order in which work uses a pool.
  • Where (placement): which machine, given locality, shared fate, price and shape.
  • Whether and how much (workload management): the gate, which keeps the other two solvable.

The two facts at the root

  • policies have the same total busy time. Order changes only the mean : for jobs of size 1 and 100, short first gives a mean of 51, long first gives 100.5.
  • The best order () needs the , and the run time is unknown at admission. Every mechanism answers "what do we do without that number?" (estimate, observe, declare, or refuse to need it).

Key mechanisms and what to remember

MechanismOne-line takeaway
Zero information, minimum of wait, but inherits the variance of job sizes ()
PriorityNeeds aging against ; inflates when the setter benefits; inversion needs inheritance
Approximates shortest-job-first from observed service; every short-query accelerator is this
Fair / Equalize each tenant's dominant share; leaves
CapacityA guarantee is only as fast as the grain of reclaim (about the p99 task duration)
SRPT folkloreOn workloads it helps most jobs, including most large ones
Optimal up to Σ(C/T) = 1, catastrophic after; needs
GangAll-or-nothing in the workload becomes atomic allocation and hoarded idle
Kill the youngest, , or migrate; the cost is the victim's unsaved progress
Wait briefly for a big ratio; the ratio moved from disk-vs-network to cache-vs-network
Packing vs. spreadingPacking maximizes blast radius; the problem is requests vs. usage, not NP-hardness
≥ ; schedule by remaining path;
Price the so users disclose it
LocalityA bandwidth-per-core question: bytes per CPU-second against network-card bandwidth per core
Human-supplied correlation; costs packing; needs a
Viable for granular, work; correlated; compare $/work, not $/hour
Shape mismatch is capped by machine shape versus task shape; the priciest resource sets the objective
Scheduler architectureMonolithic, two-level, shared-state, sampling = single lock, pessimistic, optimistic, no coordination; two random probes capture most of the value
Admission depth = latency budget; versus ; check the deadline at dequeue
Slots are static and wrong; on latency finds the ceiling
Isolation ≈ √N for independent demand; vanishes when demand correlates at peak
LanesPriority alone does not help admitted queries; lanes cost idle; bias the classifier
KillersCap on early evidence, not on elapsed time
QuotasGovern only what can be attributed; the rest is the
Handles trends, never spikes; loop delay sets what it can absorb
RoutingRoute on cheap features; bias toward the recoverable mistake

Four formulas

FormulaMeaning
L = λ × W: concurrency, throughput and latency are tied; limiting one fixes the other
worst wait = queue depth ÷ service rateThe queue depth is a latency budget
Σ (Cᵢ / Tᵢ) ≤ 1Periodic tasks are schedulable by EDF if and only if this holds
wait iff expected_wait < (1 − 1/ratio) × runtimeThe delay-scheduling rule

Patterns that repeat

  • Every guarantee is paid in idle capacity or destroyed work. There is no third currency.
  • The declarer never pays. Over-requesting, runaway tasks and priority inflation are paid by others.
  • Information is the binding constraint: estimate it, observe it, or price it.
  • Cost is conserved: every escape moves cost onto idle capacity, a co-tenant, the future, or burns it.
  • Admission is a precondition for scheduling: most "scheduler problems" are admission problems.