Kubernetes PSI Metrics: Why CPU Utilization Hides Contention

Kubernetes PSI Metrics: Why CPU Utilization Hides Contention

Cloud Platform Engineering

Two test runs on the same two-CPU Kubernetes node showed identical CPU usage of 2001m, yet one had CPU pressure of 0.33% and the other 99.63%, in an experiment published on the Kubernetes blog. For SREs and platform engineers who size nodes and set limits from utilization dashboards, that gap is the case for adding Pressure Stall Information to the toolkit: utilization says how busy a CPU is, not how long work waits for it.

How It Works

Linux Pressure Stall Information (PSI) measures time spent waiting for a resource rather than time spent using it. For CPU, the some value is the share of time at least one task was runnable but waiting for a CPU. The kernel reports it as averages over 10, 60 and 300 seconds, and the author, Nitin Ware, who works on latency-sensitive AI inference services, reads avg10 because it reacts fastest. An avg10 of 25% means that over roughly the last 10 seconds, at least one task waited about a quarter of the time.

PSI metrics are stable from Kubernetes v1.36, and the PSI metrics documentation explains how to read them. They need a Linux host with cgroup v2 and a kernel with PSI enabled. Node and pod values appear in the kubelet Summary API, under .node.cpu.psi and .pods[].cpu.psi, and per-container values are exposed through the kubelet’s cAdvisor metrics as container_pressure_cpu_waiting_seconds_total.

The test used a kind cluster on Kubernetes v1.36.1, with the worker node pinned to two CPUs, running busybox pods that each spin two busy loops:

RunSetupNode CPU in kubectl topNode CPU some.avg10
A1 pod, 2 loops2001m0.33%
B3 pods, 6 loops2001m99.63%
C1 pod, 2 loops, 500m CPU limit517m75.23%

In run A, the two loops fit on two CPUs and almost never waited. In run B, only two of six loops could run at once; per-pod usage in kubectl top actually fell, to between 616m and 708m, because the pods shared the CPUs. Only PSI showed the queue. In run C, the 500m limit throttled the pod while most of the node sat idle, and the throttling counter container_cpu_cfs_throttled_periods_total read 1905.

What This Means for You

The three runs map to three diagnoses. High utilization with low pressure means the work fits, and busy CPUs aren’t a problem by themselves. High utilization with high pressure means there’s more runnable work than CPU, so check what else is scheduled on the node, the pods’ CPU requests and placement. Pressure with spare node CPU means the pod is probably held back by its own limit, so check the throttling counters; adding nodes won’t help while the limit stays.

The experiment also shows how misleading the percentage column can be. kubectl top reported 50% node CPU in runs A and B because Kubernetes counted all four host CPUs as capacity, not the two the worker was pinned to.

The author offers no universal threshold. PSI should be compared against a workload’s own baseline and checked against latency or queue depth before anyone acts on it. This is also one small synthetic test on kind, so production numbers will differ. It pairs well with the utilization baselines in our guide to Kubernetes AI inference observability.

The So What

If you run latency-sensitive services on Kubernetes v1.36 or later, start collecting container_pressure_cpu_waiting_seconds_total next to CPU usage and throttling counters this week, record each service’s normal pressure, and before your next rightsizing or node-pool change, check whether high-latency periods line up with pressure rather than utilization.

Source: Kubernetes Blog

Content created with AI assistance and reviewed for accuracy.

💬

Join the conversation

Stack Insiders is our free community for readers who want to go deeper — share resources, ask questions, and connect with others across every vertical we cover.

Join Stack Insiders →

Newsletter coming soon.

Curated digests across AI, biohacking, photography, travel, and more. Be the first to know when we launch.