Unit 5 · Distributed & cloud · Lesson 12 of 14
Resource scheduling, fairness, interference and cold starts
Step 1: Learn the ideas
- Bin packing, requests, limits and overcommit
- Priorities, quotas and preemption
- Max-min fairness and dominant resource fairness
- Interference: last-level cache, memory bandwidth, network, disk
- Noisy neighbors and tail latency
- Isolation mechanisms: cgroups, CPU pinning, cache partitioning, VMs, microVMs
- Colocating latency-critical and batch work
- Serverless cold starts and keep-alive policies
Why it matters
Utilization is money: a cluster with low average utilization wastes most of its hardware, yet packing more work per machine risks interference that shows up as tail latency in the most important services. Cloud infrastructure roles and cloud research ask how schedulers balance this and how isolation is enforced. If you have measured interference in coursework, for example a latency-critical cache next to batch jobs, this topic gives you the vocabulary to explain it precisely.
Core ideas
Placement. Cluster schedulers filter machines by constraints and free requested resources, then score candidates (spreading for availability, packing for efficiency). Because tasks rarely use all they request, production schedulers overcommit and lend reserved but unused resources to lower-priority work, preempting or evicting it when the owner needs them back.
Fairness. With one resource, max-min fairness maximizes the smallest allocation. With several (CPU and memory), dominant resource fairness equalizes each user's dominant share, the largest fraction of any single resource the user holds, and keeps useful properties such as giving users no incentive to misreport demand.
Interference. Colocated workloads share last-level cache, memory bandwidth, hyperthread siblings, network and disk queues, and sometimes power and frequency headroom. A batch job thrashing the cache can multiply a neighbor's tail latency while average CPU utilization looks fine. Countermeasures include CPU quotas and shares (cgroups), dedicated or pinned cores, cache and memory-bandwidth partitioning on hardware that supports it, network traffic shaping, detecting antagonists from per-task hardware counters such as cycles per instruction, and feedback controllers that throttle best-effort work as the latency-critical service nears its target.
Isolation inside services. Multi-tenant services face the same problem one level up: one tenant's burst or poisonous request can starve the rest. Per-tenant quotas and admission control bound the damage, and shuffle sharding maps each tenant to a small random subset of workers so that one tenant's trouble touches few others.
Isolation versus overhead. Containers are dense and start quickly but share a kernel; VMs isolate more strongly at higher overhead; microVMs aim for VM-grade isolation with near-container density and startup time, which is why some multi-tenant serverless platforms use them.
Cold starts. An invocation without a warm instance must provision an isolated environment, fetch code or an image, start the runtime and run initialization. Mitigations (keeping instances warm, pre-warming from predicted demand, snapshotting initialized state, lazy image loading) all trade idle resources or complexity for latency.
Common misconceptions
- "CPU limits isolate tenants." They cap CPU time but not cache, memory-bandwidth or I/O contention.
- "Higher utilization is always better." Past some point, interference and queueing raise tail latency faster than cost falls.
- "Fair means equal shares of each resource." Workloads need different mixes; multi-resource fairness is defined differently.
- "Cold starts are a fixed platform cost." They depend on image size, runtime initialization and keep-alive policy, all of which you can influence.
How to approach it
Read the Borg paper for scheduling and reclamation, CPI2 for detecting and throttling noisy neighbors, the shuffle-sharding article for tenant isolation inside services, Firecracker for isolation versus density, and the Lambda container-loading paper for cold starts; connect each to Kubernetes requests, limits and QoS. Work DRF by hand from the definition above; the research-cloud topics on scheduling and interference go deeper into fairness and colocation papers. In interviews, explain one experiment or design you know well in terms of the shared resource, the metric affected and the isolation mechanism that would address it, without overstating what your measurements showed.
Suggested order
- 1Read the Borg paper sections on priority, quota and admission control, on scheduling, and on resource reclamation.
- 2Compute dominant resource fairness allocations by hand for two users with different CPU and memory demands, using the definition in the notes.
- 3Read the CPI2 paper for how interference is detected from hardware counters and how antagonists are throttled.
- 4Read the Builders' Library article on shuffle sharding and estimate how many tenants share a fate under plain sharding versus shuffle sharding.
- 5Read the Firecracker paper's motivation and design sections on isolation versus overhead, then the Lambda container-loading paper (6.5840 LEC 17 reading) and list the stages of a cold start.
- 6On a local cluster, run a CPU-heavy pod next to a latency-sensitive pod with and without a tight CPU limit and observe throttling and latency.
Step 2: Check off what you can do
Tap each one you can genuinely do or explain. Each earns 10 XP.
Step 3: Go deeper
Large-scale cluster management at Google with BorgStart here
Google ResearchProduction cluster scheduling: priorities, quota, packing, reclamation and isolation.
Open(opens in a new tab)Link responded, 5 Oct 2026CPI²: CPU performance isolation for shared compute clustersStart here
Google ResearchDetecting performance interference with hardware counters and throttling the antagonists.
Open(opens in a new tab)Link responded, 5 Oct 2026Workload isolation using shuffle-sharding
Amazon Builders' LibraryLimiting how many tenants a noisy or poisonous tenant can affect inside a shared service.
Open(opens in a new tab)Link responded, 5 Oct 2026Firecracker: Lightweight Virtualization for Serverless Applications
USENIXIsolation strength versus density and startup time in multi-tenant serverless.
Open(opens in a new tab)Link responded, 5 Oct 2026MIT 6.5840 Distributed Systems
MIT PDOSSection: LEC 17: AWS Lambda (reading: On-demand Container Loading in AWS Lambda)
How a serverless platform cuts cold-start latency for large container images by loading them lazily and caching shared blocks.
Open(opens in a new tab)Link responded, 5 Oct 2026
Step 4: Practice
Extend the kind exercise: run a latency-sensitive service next to a CPU- or memory-heavy neighbor and measure its tail latency with and without CPU limits and with the service in the Guaranteed QoS class; note which interference the limits do not remove. If you ran colocation or interference experiments in coursework, rewrite one result as a two-minute explanation naming the shared resource, the affected metric and the mechanism that would address it, sticking strictly to what you measured.
- Break and fix a toy service on a local kind cluster (probes, requests, limits)Open(opens in a new tab)Not attemptedkind (Kubernetes SIGs)
Record attempts on each problem’s page (+15 XP, +10 more when solved on your own).
Step 5: Test yourself
Answer each one out loud or on paper before you finish the lesson.
- Question 1Why do production schedulers overcommit, and what makes it safe?
- Question 2What is a dominant share?
- Question 3Why can tail latency rise while average CPU utilization stays low?
- Question 4When would you choose a microVM over a container?
- Question 5What does a keep-alive policy trade off?
You’re done when you can
- Compute DRF allocations for a small two-user example by hand.
- Name four shared resources that cause interference and an isolation mechanism for each.
- Explain the stages of a cold start and two mitigations with their costs.
Finish the lesson
Unlocks next: Cluster scheduling, bin packing and fairness, Interference, noisy neighbors and performance isolation


