advanced25 min studyLesson 361 in Engineering

Resource requests and feasibility

Separate admission accounting, runtime consumption, and enforcement while checking every required resource dimension.

On this page

What you’ll understand

  • Check residual capacity using compatible units and all dimensions.
  • Distinguish declared requests from limits and measured usage.
  • Explain why a feasible accounting vector does not guarantee application performance.

A training worker asks for CPUs, host memory, and an accelerator. A dashboard shows low average CPU usage, yet the scheduler refuses another worker. That can be correct: placement is usually based on declared accounting and constraints, while runtime usage changes afterward. A reliable feasibility test identifies which quantities it compares, their units, and which additional conditions must hold before the application can actually run.

Keep three different quantities separate

A request represents the resource quantity used by the scheduling or admission policy. A limit governs a runtime constraint under the platform’s enforcement mechanism. Measured usage records what the workload consumed over a particular observation interval. They can differ substantially. An idle process can retain its resource request, and a workload may consume more CPU than its request when permitted capacity is available. Do not infer that unused requested capacity has automatically become schedulable capacity under the same policy.

In Kubernetes, CPU and memory requests inform scheduling, while limits have resource-specific runtime behavior. CPU enforcement can throttle execution; memory pressure or limit enforcement can lead to termination rather than slowing memory use smoothly. Device resources can follow additional allocation and sharing contracts. Avoid transferring a CPU-sharing intuition to GPU memory without checking the actual implementation. The declared values should reflect supported workload behavior and operational policy, not simply the smallest numbers that make one test placement succeed.

∀r,qr≤Cr−Ar\forall r,\qquad q_r\leq C_r-A_r
For each resource r, requested quantity q_r must fit allocatable capacity C_r minus already accounted allocations A_r. All three quantities use the same resource-specific unit; CPU cores cannot be added directly to GiB.↔ Scroll wide equations horizontally.

A resource vector is only part of feasibility

Use allocatable capacity after system reservations rather than the machine’s advertised total. Include relevant overhead and account for the workload’s execution shape, such as simultaneously running containers or worker replicas. Then check hard constraints: device type, node labels, storage availability, topology, and required affinity. Summing free GPUs across the cluster does not place a task requiring several compatible devices on one host. A quota admission decision may also be separate from the final pod-to-node scheduling decision.

Declared accounting can fit while actual execution still performs poorly. Requests do not model every shared bottleneck, such as network fabric contention, memory bandwidth, or accelerator interconnect. Collect per-stage metrics and peak usage, including model loading and checkpoint bursts. Adjust declarations through a controlled process that watches failures and latency. Blindly shrinking requests because average usage is low can create overcommitment that appears efficient until synchronized bursts arrive. Record the safety margin and the evidence behind it.

ur=ArCr,0≤ur≤1u_r=\frac{A_r}{C_r},\qquad0\leq u_r\leq1
This is accounted utilization for one non-overcommitted resource pool, not observed runtime utilization. A_r and C_r have identical units, making u_r dimensionless. The displayed range assumes the admission policy forbids over-allocation.↔ Scroll wide equations horizontally.

Normalize carefully and investigate rejection reasons

Normalize each dimension by its own capacity when comparing shapes, but retain the original units for decisions and debugging. A normalized vector can show that memory is tight while CPU has room. It cannot reveal whether the requested accelerator model exists or whether a storage volume is attachable. Report concrete infeasibility reasons rather than a generic pending status: insufficient requested memory, incompatible device type, and unsatisfied topology imply different remedies. A larger cluster may not fix a constraint that every new node also violates.

Use the vector lab for a two-resource normalized example. Reset, set angle to 45 degrees and magnitude to 1, predict both components, then Step. Treat unit capacity in each positive axis as a separate resource budget. For a fresh comparison, Reset and explicitly set angle to 45 degrees and magnitude to 2, predict whether either component exceeds one, then Step. The instrument draws one vector and projections only; it has no nodes, live allocations, limits, or scheduling decisions.

Check the binding dimension

A node has 16 allocatable CPU cores and 64 GiB of host memory. Existing requests account for 10 cores and 40 GiB. A worker requests 4 cores and 28 GiB. Ignore every other constraint for this arithmetic test.

  1. Compute residual accounting capacity: 16 − 10 = 6 cores and 64 − 40 = 24 GiB. The quantities remain separate dimensions.

  2. Compare the worker request componentwise. Four cores fit in six, but 28 GiB does not fit in 24 GiB. CPU availability cannot compensate for the missing four GiB.

  3. Reject this placement under the stated policy. If memory request were justified at 20 GiB instead, both resource checks would pass, while device, topology, and runtime behavior would still need verification.

The result

Memory is the blocking declared resource. Low measured CPU usage does not change this componentwise accounting result.

Explore the model

Interactive lab

Interactive lab · vectors

Requests have separate normalized components

Reset, set angle = 45° and magnitude = 1, predict x and y, then Step. Compare a fresh Reset with both angle = 45° and magnitude = 2. Each positive axis has a hypothetical unit capacity; this is one vector, not a placement solver.

Requests have separate normalized componentsPlayback traces a fixed vector and its projections. Angle and magnitude set the geometry; the moving marker does not change them. Current readings: x component: 1.393; y component: 0.975; Magnitude: 1.7. All parameters are adjustable with the labeled controls below.−7.46−3.7303.737.46−3.5−1.7501.753.5xyvvₓ = 1.39
Vectorx / y projectionsTrace marker
x component
1.393
y component
0.975
Magnitude
1.7
t = 0 s

Playback traces a fixed vector and its projections. Angle and magnitude set the geometry; the moving marker does not change them. 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 forA request must satisfy each resource constraint; unused capacity in one dimension cannot replace another.

Check your understanding

A node has enough unused measured CPU but its declared memory requests leave less capacity than a new worker requests. What follows under request-based placement?

Try it yourself

A node has 12 allocatable cores and 48 GiB. Existing requests use 7 cores and 30 GiB. Test a request for 5 cores and 18 GiB, then one for 5 cores and 19 GiB. Explain why passing the first test does not guarantee accelerator compatibility.

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

Give me a hint

Equality fits in this simplified policy, but each resource still needs its own comparison.

Compare with the solution

Residual capacity is exactly 5 cores and 18 GiB. The first request fits both dimensions; the second exceeds memory by one GiB. Neither test includes accelerator type, count, memory layout, or sharing rules. Those constraints must be checked separately, along with overhead and other platform conditions omitted from this arithmetic example.

Take it with you

  • Requests, limits, and measured usage are different contracts and observations.
  • Feasibility is componentwise and uses allocatable capacity with compatible units.
  • Resource fit is necessary but does not establish all placement constraints or performance.

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.