Cloud & infrastructure

Diagnosing Kubernetes CPU contention with Pressure Stall Information

CPU utilization metrics often hide resource contention. Learn how Linux PSI metrics reveal waiting times for CPU, helping engineers distinguish between busy workloads and throttled ones.

Illustration of CPU contention with tangled threads around processors
Illustration generated for this article

Traditional CPU utilization metrics fail to distinguish between a node that is efficiently busy and one where tasks are starving for processor time. In December 2026, the Kubernetes project highlighted how Pressure Stall Information (PSI) provides this missing visibility, offering a clearer picture of resource contention for latency-sensitive applications.

What happened

Engineers managing AI inference services often face a debugging paradox: high CPU usage does not always explain high latency. A node can appear fully utilized while tasks wait in queues for CPU cycles, or it can show moderate usage while specific pods are artificially throttled by limits. To address this, the Kubernetes community demonstrated how PSI metrics, stable since version 1.36, expose the time tasks spend waiting for CPU resources rather than just executing.

The investigation involved running identical workloads on a Kubernetes node restricted to two CPUs. In the first scenario, two busy loops ran on two dedicated CPUs. In the second, six loops competed for the same two CPUs. While kubectl top reported identical CPU usage of 2001m for both scenarios, the underlying pressure metrics told a different story. The first run showed negligible pressure, while the second showed near-total saturation, revealing that utilization alone is an insufficient diagnostic tool for contention.

A third scenario tested a single pod with a strict CPU limit on a node with spare capacity. Despite the node being mostly idle, the pod experienced significant pressure due to throttling. These experiments illustrate that high utilization can be healthy, while high pressure indicates a bottleneck, whether from competition or configuration limits.

How it works

Pressure Stall Information is a Linux kernel feature that measures the amount of time tasks are stalled waiting for specific resources. For CPU, PSI reports two main metrics: some and full. The some metric indicates the percentage of time at least one task was ready to run but waiting for CPU access. The full metric tracks time when all non-idle tasks were waiting simultaneously. For most debugging purposes, some is the more sensitive indicator of contention.

Kubernetes exposes these metrics through the kubelet Summary API and cAdvisor. Engineers can query the node or individual pod stats to see avg10, avg60, and avg300 values, representing average pressure over the last 10, 60, and 300 seconds. The avg10 value is particularly useful for detecting sudden spikes in contention that correlate with latency issues. When using Prometheus, these signals are available as container_pressure_cpu_waiting_seconds_total, allowing for historical analysis and alerting.

Key details

  • PSI metrics became stable in Kubernetes v1.36, ensuring reliable support for production monitoring.
  • CPU utilization can remain constant while CPU pressure varies from near 0% to nearly 100%, depending on task scheduling.
  • The some.avg10 metric provides a rapid response to changes in workload contention, making it ideal for real-time debugging.
  • Pod-level PSI data helps identify if a specific application is throttled by its own CPU limits rather than node-wide competition.
  • Throttling counters, such as container_cpu_cfs_throttled_periods_total, complement PSI by confirming if limits are the cause of pressure.
  • Accessing PSI requires a Linux host with cgroup v2 and a kernel with PSI enabled, which is standard in most modern distributions.

Why it matters

For software engineers building latency-sensitive systems, distinguishing between efficient utilization and harmful contention is critical. High CPU usage is often treated as a warning sign, prompting premature scaling or optimization efforts. However, if the pressure is low, the system is likely handling the load efficiently. Conversely, low utilization with high pressure suggests misconfigured limits, leading engineers to waste resources adding capacity that will not improve performance because the bottleneck is artificial.

Integrating PSI into observability stacks allows teams to set more accurate alerts. Instead of triggering alarms based solely on CPU percentage, engineers can monitor pressure trends relative to application latency. This context helps prioritize investigations: high pressure with high latency points to resource starvation, while high latency with low pressure suggests issues within the application logic or downstream dependencies. This precision reduces mean time to resolution and prevents unnecessary infrastructure costs.

What you can do

  • Verify your cluster runs Kubernetes v1.36 or later to ensure stable PSI metric exposure.
  • Query the kubelet Summary API using kubectl get --raw to inspect current node and pod PSI values.
  • Monitor container_pressure_cpu_waiting_seconds_total in Prometheus to track contention history.
  • Compare avg10 pressure spikes with application latency traces to confirm if CPU waiting causes delays.
  • Check container_cpu_cfs_throttled_periods_total when high pressure occurs on nodes with spare capacity.
  • Establish baseline pressure levels for each service to differentiate normal operation from anomalous contention.
  • #kubernetes
  • #performance
  • #linux
  • #observability
  • #cpu

Tools from the Bytechap store

Keep reading

All stories