News

How Kubernetes Memory QoS affects inference under pressure

In brief

Host-memory throttling can keep an inference process alive while its requests slow down. Effective kubelet settings and request deadlines explain the tradeoff.

5 min read

Sources
A continuous blue felt loop stays intact beneath a slate plate while ivory ribbons bunch at its narrowed passage.
Conceptual illustration of survival with slower work under pressure. It is not a GPU-memory policy, guaranteed protection or measured result of Kubernetes Memory QoS.
On this page4 sections

A serving process that survives memory pressure can still disappoint every request waiting on it. That makes “fewer restarts” an incomplete answer to whether a new memory policy improved inference. Kubernetes Memory QoS gives operators additional ways to influence pressure, but the useful choice depends on how the application behaves while it stays alive.

The September 14 announcement promotes Memory QoS to beta in Kubernetes v1.37 and enables its feature gate by default on the relevant Linux cgroup v2 path. The default kubelet configuration nevertheless enables neither memory throttling nor reservation. Those behaviors require separate opt-in, so the feature-gate state alone does not explain what a node will do.

This is host-memory behavior in the Linux cgroup memory controller. It is not a GPU-device-memory allocation policy or a fix for model output errors. For an inference operator, the immediate question is what effective node settings changed and whether they improve the useful responses delivered under pressure.

Why similar node templates can behave differently

The announcement changes the default of memoryThrottlingFactor from the alpha value 0.9 to null. An explicit setting still matters. A node that previously inherited its behavior from the default can therefore differ from one whose configuration wrote the old value explicitly.

Determine whether memoryThrottlingFactor is absent, explicitly set or generated by node-management tooling in the configuration the node actually received. The application manifest and version-controlled node template do not settle that question: an upgrade or rollout tool can rewrite kubelet settings. Save the node’s effective values before and after the change so the pressure test can be attributed to the configuration it exercised.

The request-level cost of keeping a process alive

The Kubernetes QoS documentation distinguishes throttling via memory.high from protection via memory.min and memory.low. The hard memory limit remains separate. Setting a throttling threshold does not promise that the application can never exhaust memory; it changes how pressure is encountered.

The application’s deadline gives that change its meaning. A brief delay may be acceptable for background work and unacceptable for interactive inference. Batch and interactive workloads therefore need separate deadline tests, with conclusions limited to the configuration and pressure conditions actually exercised.

In a hypothetical inference trial, throttling reduces container restarts while requests spend longer waiting. The platform change has been delivered successfully, but its user-facing benefit remains undecided. Counting successful requests within the latency objective reveals whether the service improved or merely replaced one failure symptom with another.

The release also describes a node-wide constraint: tiered reservation applies across the node’s pods rather than allowing individual pod opt-in. Protected memory can include page cache. Neighbors with different memory behavior therefore make workload placement part of the policy choice, not background detail to omit from the test.

Survival and responsiveness are different results
Survival and responsiveness are different results
A conceptual comparison under memory pressure. Count restarts and request behavior together; fewer terminations do not by themselves establish better inference service.
Read diagram description

A conceptual comparison under memory pressure. Count restarts and request behavior together; fewer terminations do not by themselves establish better inference service. Diagram labels: Memory pressure: Same representative workload and host constraints; Container behavior: Throttling and restarts; Request behavior: Latency, errors and completions; Compare with baseline: Keep the policy only if the service tradeoff is acceptable.

Comparing serving behavior under memory pressure

The pressure test needs a request-level target, such as successful responses within the service’s latency objective; fewer process terminations alone leave that target unresolved. On a representative inference node, keep a baseline of current settings and hold the model, request mix, concurrency and neighboring workloads consistent. Changing one policy at a time lets the test explain its effect instead of mixing an upgrade, reservation and application tuning into one result.

For interactive serving, memory usage, pressure and terminations need to be read alongside latency and completed work. Streaming introduces two waits: the first token and the complete response. Record output length with both, so a longer answer is not mistaken for a resource regression. Retrieval or preprocessing work instead needs completion time and retry effort because its useful endpoint is different.

A short synthetic trial has a legitimate but limited reach. It may miss cache growth, large reads or dependency behavior that appears over an operating day. A bounded rollout can investigate those remaining conditions after the initial comparison succeeds; the small trial should not claim to have exercised them already.

The service-level objectives guide helps connect those observations to user expectations, while the Linux performance tuning guide explains the surrounding resource investigation. Together they keep the question specific: which observed bottleneck or failure is this setting supposed to improve?

Rollback includes kubelet configuration

The announcement warns that disabling the feature also requires compatible kubelet settings. Reversing only its feature gate may leave configuration needing attention. Rehearsing the release-specific reversal outside production, then checking actual node state against the baseline, establishes what the rollback really restores.

A compact rollout record can keep the comparison usable for the next operator:

  • Node version and cgroup v2 status identify the path under test
  • Effective throttling and reservation settings show the before-and-after change
  • Workload mix and service objective explain what success means
  • Observed results, reversal trigger and an authorized owner make the next decision actionable

Fewer restarts and more responses completed within the latency objective would support keeping the policy for the tested workload. Fewer restarts with worse useful response rate would support reversing it. Recording the effective kubelet settings makes either result reproducible and tells the next operator which configuration to restore.

Sources & context

Sources linked in this article. Read alongside the author’s analysis; a citation does not independently verify a publisher’s claims.

Report an error or outdated detail

Related reading

Explore a related question