advanced25 min studyLesson 368 in Engineering

Queue fairness and aging

Define waiting, entitlement, and job progress explicitly while evaluating starvation and large-job admission.

On this page

What you’ll understand

  • Distinguish FIFO, priority, fair share, and aging policies.
  • Compute a simple bounded aging score with explicit units.
  • Explain why priority cannot fix infeasibility or sustained overload.

A scheduler starts small experiments quickly while one large training job waits for hours. Average queue time looks good because many short jobs dominate the sample. Queue fairness must name who is being protected, what waiting means, and which constraints limit admission. Aging can increase the importance of old work, but its guarantee depends on the rest of the scheduling policy and on there being a feasible opportunity to run.

Choose the fairness unit and observation boundary

FIFO orders arrival times, static priority favors configured classes, and fair-share policies compare consumption or entitlement across identities. None of these descriptions completely specifies a scheduler. A strict head-of-line job can block feasible work behind it, while backfilling can improve utilization if it does not invalidate a protected future start under the supported assumptions. A stream of small jobs can prevent a large gang from ever accumulating enough free resources unless the policy reserves or reclaims a suitable group.

Define the identity receiving fairness: job, user, team, project, or service class. Fairness by job can reward a tenant for splitting one workload into many submissions. Report wait distributions by identity and shape, including rejected and cancelled work rather than only admitted jobs. Separate time waiting for quota from time waiting for physical placement or application readiness. A job whose requirements exceed the entire eligible cluster needs a clear infeasibility outcome, not indefinite promotion through a queue that can never satisfy it.

Pi=P0,i+αmin⁡(wi,Wmax⁡)P_i=P_{0,i}+\alpha\min(w_i,W_{\max})
This illustrative aging policy adds priority points at alpha points per minute to waiting time w_i in minutes, capped after W_max minutes. It is not Slurm’s full multifactor formula; tie-breaking, class boundaries, and eligibility are separate rules.↔ Scroll wide equations horizontally.

Aging is a policy component, not a liveness proof

An increasing score can help old work outrank new work within its allowed class. A cap may deliberately preserve class separation but can also leave a lower-priority job permanently behind an endless higher-priority stream. An uncapped score changes those tradeoffs and may conflict with urgent-service expectations. State whether aging survives retries, preemption, or user edits; otherwise a job can lose accumulated waiting credit or manipulate its position. Keep score components visible enough for users to understand a decision without revealing other tenants’ sensitive details.

Fairness and job-completion time are different objectives. A policy based on attained service can favor jobs that have consumed little so far without requiring exact remaining runtime, but that choice has assumptions and starvation countermeasures. Tiresias studies this setting for distributed deep learning. Do not interpret a paper’s improvement on its evaluated traces as proof that an arbitrary aging coefficient benefits your fleet. Large-job shape, placement locality, runtime uncertainty, and preemption overhead affect outcomes beyond queue rank.

wi=tadmit,i−teligible,iw_i=t_{\mathrm{admit},i}-t_{\mathrm{eligible},i}
For an admitted job, this waiting interval uses one consistent clock and eligibility boundary, giving seconds or minutes. Submission-to-start is a different measure when eligibility checks or application startup consume additional time. Unadmitted jobs are censored, not zero-wait observations.↔ Scroll wide equations horizontally.

Separate ordering from service capacity

When sustained admitted demand exceeds the resources that can complete work, no ordering policy can give every job a fixed finite wait without changing admission or capacity assumptions. Combine fairness with quotas, overload handling, feasible reservation, or scaling. Watch the oldest eligible wait and large-gang progress alongside average completion metrics. A scheduler can improve an average by indefinitely postponing a small number of expensive jobs, which is a policy choice that should be visible rather than hidden inside a favorable headline.

The queue lab demonstrates only the capacity condition. Reset, set arrival rate to 4 and service rate to 3, predict backlog after one second, then Step twice. For a separate run, Reset and explicitly set arrival rate to 2 and service rate to 3, predict, then Step twice. Both begin with four equal abstract jobs. The fluid slope can show overload, but there is no priority, aging, tenant identity, or variable job size. Explain why changing queue order alone cannot reverse its rate imbalance.

Compute a capped aging comparison

Use the toy score with alpha = 2 points per minute and a 20-minute cap. Job A has base priority 10 and has waited 12 minutes. Job B has base priority 25 and has waited 3 minutes. Both are feasible and in the same eligible class.

  1. A’s aging contribution is 2 × min(12,20) = 24, giving total priority 10 + 24 = 34.

  2. B’s contribution is 2 × min(3,20) = 6, giving total priority 25 + 6 = 31. Under this toy comparison, A ranks first.

  3. After the cap, A can gain no more than 40 aging points, so its score cannot exceed 50 without another policy change. This cap alone cannot guarantee admission against every possible stream of higher-ranked feasible work.

The result

Aging can reverse a base-priority comparison, while caps and class rules constrain what starvation protection it provides.

Explore the model

Interactive lab

Interactive lab · queue

Fair ordering cannot create capacity

Reset, set arrival rate λ = 4 and service rate μ = 3, predict the one-second backlog, then Step twice. Compare a fresh Reset with both λ = 2 and μ = 3. This fluid queue has no age, priorities, tenants, or variable job sizes.

Fair ordering cannot create capacityFluid backlog starts at 4 and follows max(0, 4 + (λ − μ)t). The separate M/M/1 residence-time formula assumes Poisson arrivals, exponential service and λ < μ. Current readings: Fluid backlog: 4; Net rate · λ − μ: −1 /s; M/M/1 mean residence: 1 s. All parameters are adjustable with the labeled controls below.02.557.51001.534.56Elapsed time · sFluid backlogλ < μ
Fluid backlogCurrent time
Fluid backlog
4
Net rate · λ − μ
−1 /s
M/M/1 mean residence
1 s
t = 0 s

Fluid backlog starts at 4 and follows max(0, 4 + (λ − μ)t). The separate M/M/1 residence-time formula assumes Poisson arrivals, exponential service and λ < μ. Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.

Look forOrdering fairness and sustained resource balance are separate requirements.

Check your understanding

A waiting job’s aging score rises, but its required eight compatible GPUs cannot fit any eligible domain in a four-GPU cluster. What does aging establish?

Try it yourself

With base priority 8, alpha = 3 points per minute, and cap 10 minutes, compute scores after 4 and 15 minutes. Explain why reporting an average wait only for admitted jobs can hide starvation.

Take a moment to make a prediction or work it out on paper. Open a hint when you need one.

Give me a hint

Apply the cap before multiplication; then consider jobs that never enter the sample.

Compare with the solution

The scores are 8 + 3 × 4 = 20 and 8 + 3 × 10 = 38. A still-pending starved job has no completed admission interval and may be omitted from an admitted-only mean. Report censored waiting work, oldest eligible wait, and per-shape or per-tenant distributions so the metric does not reward excluding difficult jobs.

Take it with you

  • Fairness requires an explicit identity, eligibility boundary, and time horizon.
  • Aging affects ranking under its caps and class rules but does not guarantee feasibility.
  • Observe unadmitted and large-job waits alongside averages and resource balance.

Read further

Original sources and deeper explanations to follow at your own pace.

Optional progress, saved in this browser when available. Revisit any lesson at any time.

Lesson not marked complete.