interviewpath
  • 0day streak
  • 10total XP
  • Level 1
0/6

Unit 13 · Cloud research · Lesson 1 of 5

Cluster scheduling, bin packing and fairness

Cluster schedulers decide which work runs, where it runs and who gets resources; those choices set utilization, cost, tail latency and fairness. Cloud research often starts here, so you should be able to state placement as constrained multi-dimensional bin packing, explain multi-resource fairness such as DRF, and evaluate a policy honestly.
About 4 hFocus mode

Step 1: Learn the ideas

  • Scheduler roles: admission, placement, preemption, rescheduling
  • Multi-dimensional bin packing and placement heuristics
  • Fragmentation and stranded resources
  • Requests versus limits, overcommit and reclamation
  • Compressible versus non-compressible resources and QoS classes
  • Priorities, quota and preemption
  • Fairness: max-min, weighted fair share and Dominant Resource Fairness
  • Gang scheduling and topology-aware GPU placement (awareness)
  • Scheduler architectures: monolithic, two-level, shared-state
  • Evaluation: utilization, cell compaction, scheduling delay, SLO attainment

Why it matters

A cluster scheduler decides which work runs, where it runs and what happens when resources run out. Those decisions set utilization, cost, tail latency and fairness between users. Many cloud research questions start here, so you should be able to state placement as a constrained, multi-dimensional bin-packing problem, explain multi-resource fairness, and evaluate a policy without fooling yourself.

Core ideas

What a scheduler does. Admission (is there quota or capacity?), placement (which machine?), preemption (whom to evict for more important work?) and rescheduling after failures or rebalancing. Kubernetes splits placement into filtering feasible nodes and scoring them; Borg uses the same two phases, called feasibility checking and scoring.

Packing heuristics. Placement over several resources (CPU, memory, GPUs, disk, network) with constraints is NP-hard in general, so production systems use heuristics. Best fit packs tightly and leaves whole machines free for large tasks, but punishes misestimated requests and concentrates interference. Worst fit (spreading) keeps headroom for load spikes but fragments capacity, stranding resources that large tasks cannot use. Borg reports that a hybrid aimed at reducing stranded resources, such as CPU left on a machine whose memory is full, packs better than best fit for its workload. Kubernetes exposes similar choices through scoring strategies such as MostAllocated (pack) and LeastAllocated (spread).

Requests, limits and overcommit. Declared requests usually exceed actual use. Borg schedules production work against limits but lets batch work run in reclaimed resources, estimated from observed usage plus a safety margin. Compressible resources (CPU, I/O bandwidth) can be throttled; non-compressible ones (memory, disk) force a kill or eviction. Kubernetes QoS classes (Guaranteed, Burstable, BestEffort) encode a similar idea for eviction under node pressure. Overcommit is a statistical bet: uncorrelated workloads rarely peak together, and correlated peaks break the bet.

Priorities and quota. Higher-priority work may preempt lower-priority tasks; quota bounds how much high-priority work each user can submit, which keeps the high-priority load feasible.

Fairness across several resources. Dominant Resource Fairness gives each user a dominant share, the largest fraction they hold of any single resource, and equalizes dominant shares. Example: a cluster has 12 CPUs and 24 GB. User A's tasks need 1 CPU and 4 GB (memory-dominant, 1/6 of memory per task); user B's need 2 CPUs and 1 GB (CPU-dominant, 1/6 of the CPUs per task). Equal dominant shares mean equal task counts, and CPU caps both at 4 tasks: A gets 4 CPUs and 16 GB, B gets 8 CPUs and 4 GB, each with dominant share 2/3. DRF provides sharing incentive, strategy-proofness, envy-freeness and Pareto efficiency; asset fairness can violate sharing incentive, and competitive equilibrium from equal incomes is not strategy-proof.

Architectures (awareness). Monolithic schedulers (Borg, the default Kubernetes scheduler), two-level designs where a resource manager offers resources to framework schedulers (Mesos), and shared-state designs with optimistic concurrency (Omega). GPU clusters add gang scheduling (all workers of a job or none) and topology awareness.

Evaluation. Average utilization is a weak metric because it ignores headroom, constraints and SLOs. Borg compared policies with cell compaction: the smallest cell that still fits a fixed workload, over repeated randomized trials. Also report scheduling delay, SLO violations of latency-sensitive services, evictions, stranded resources and per-user fairness.

Common misconceptions

  • "Best fit is the most efficient policy." It maximizes packing for a snapshot but raises eviction and interference risk when estimates are wrong; real schedulers blend scores.
  • "Higher utilization is always better." For latency-critical services it trades against tail latency; batch work in reclaimed resources helps only if isolation holds.
  • "Fair sharing of several resources means equal shares of each." Users need different mixes; DRF equalizes dominant shares instead.
  • "Requests reflect real usage." They are often inflated, which is why reclamation and right-sizing exist.
  • "Results on synthetic Poisson arrivals transfer to production." Real workloads have heavy tails, constraints and correlated arrivals; validate on traces and report sensitivity.

How to approach it

Compute a DRF allocation by hand, then write a small packing simulator over a trace sample and compare heuristics by machines needed and stranded resources. A typical research-interview prompt is "how would you evaluate a new packing policy?": answer with the workload source, baselines, metrics including SLO effects, methodology and threats to validity.

Suggested order

  1. 1Read the Kubernetes scheduler overview and the Resource Bin Packing page; list the filter and score phases and the scoring strategies.
  2. 2Read Borg sections 2.5 (Priority, quota, and admission control), 3.2 (Scheduling) and 5 (Utilization), including the evaluation methodology in 5.1.
  3. 3Read the DRF paper through its allocation properties and its comparison with asset fairness and CEEI, then compute two DRF allocations by hand.
  4. 4Read the Kubernetes Pod QoS page and relate Guaranteed, Burstable and BestEffort to compressible and non-compressible resources.
  5. 5Do the packing simulator project on a trace sample and write up machines needed, stranded resources and fairness.

Paper guides: Large-scale cluster management at Google with Borg

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 Research

    Feasibility checking and scoring, stranded resources, priorities, quota, reclamation and the cell-compaction evaluation method.

    Open(opens in a new tab)Link responded, 5 Oct 2026
  • Dominant Resource Fairness: Fair Allocation of Multiple Resource TypesStart here

    USENIX

    The dominant-share definition, progressive filling and the fairness properties DRF provides.

    Open(opens in a new tab)Link responded, 5 Oct 2026
  • Kubernetes components (official documentation)

    Kubernetes project

    Section: Kubernetes Scheduler

    How a widely deployed scheduler filters and scores nodes, as a concrete reference design.

    Open(opens in a new tab)Link responded, 5 Oct 2026
  • Kubernetes: Pod Quality of Service classes, CPU management and bin packing

    Kubernetes project

    Section: Resource Bin Packing

    Packing versus spreading scoring strategies, plus QoS classes, priority and eviction behavior.

    Open(opens in a new tab)Link responded, 5 Oct 2026
  • Azure Public Dataset

    Microsoft Azure and Microsoft Research (GitHub)

    Section: Azure traces for packing 2020

    A public VM-request trace intended for evaluating packing algorithms.

    Open(opens in a new tab)Link responded, 5 Oct 2026

Step 4: Practice

Write a simulator that places sampled tasks (CPU and memory requests) on identical machines with first fit, best fit and worst fit, and report machines needed and stranded CPU and memory. Add a second request mix and compute DRF shares for two or three users by progressive filling. If your coursework scheduled jobs on Kubernetes, restate that policy in these terms and say which heuristic it resembled and what it ignored.

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.

  1. Question 1What is a stranded resource, and which heuristic tends to create it?
  2. Question 2Why does Borg schedule production work against limits but batch work against reservations?
  3. Question 3What does strategy-proofness mean, and why does it matter in a shared cluster?
  4. Question 4Why is average utilization a misleading evaluation metric?
  5. Question 5What problem does gang scheduling solve for distributed training jobs?

You’re done when you can

  • Compute a DRF allocation for a two-user, two-resource example and check its properties.
  • Explain the trade-off between best fit and worst fit with a concrete stranded-resource example.
  • Explain requests, limits, reclamation and QoS classes and the risk each creates for latency-critical services.
  • Propose an evaluation plan for a new placement policy with workload, baselines, metrics and threats to validity.

Finish the lesson

How confident do you feel?

Lesson complete!

+50 XP

Reviews will come up on the Practice tab so it sticks.

Your notes and study time

Log study time