The metrics provided by Linux Pressure Stall Information (PSI) offer deeper insight into system performance than mere CPU utilization figures, particularly when diagnosing slowdowns in latency-sensitive AI inference services.
When investigating performance degradations, system operators often begin by examining CPU utilization; however, this metric alone fails to differentiate between a workload actively consuming CPU time and one that is stalled while awaiting CPU scheduling. This distinction prompted an investigation into PSI, which quantifies that waiting time. A node can appear fully utilized whether it hosts two tasks on two CPUs or six tasks contending for those same two CPUs; the resulting CPU utilization may look similar, but the amount of waiting can vary significantly. PSI measures this waiting. Kubernetes makes PSI accessible via the kubelet, and these performance indicators have been consistent since Kubernetes version v1.36.
To validate this concept, the author executed the identical workload under two distinct configurations on a Kubernetes node constrained to two CPUs. In both trials, the command `kubectl top` indicated the node was consuming 2001m of CPU, signifying both processing units were fully occupied. Nevertheless, the CPU pressure registered 0.33% during the initial execution, contrasting sharply with 99.63% in the second scenario.
PSI specifically quantifies the proportion of time during which at least one process was ready to execute but was held back by the CPU. This is presented as a percentage. For instance, an `avg10` reading of 25% suggests that, across approximately the preceding ten seconds, at least one task experienced a waiting period for a quarter of that time. The kernel furnishes these statistics averaged over intervals of 10, 60, and 300 seconds (`avg10`, `avg60`, and `avg300`). The author favors `avg10` due to its rapid responsiveness to workload modifications. Additionally, PSI reports `full`, which represents the fraction of time when every task was simultaneously waiting; this metric was not utilized in this analysis.
The kubelet's Summary API aggregates both CPU usage and PSI data for the entire node, as well as for individual pods and containers, accessible via the command: `kubectl get --raw "/api/v1/nodes//proxy/stats/summary" | jq '{cores: (.node.cpu.usageNanoCores / 1e9), psi: .node.cpu.psi}'`. For granular, per-pod data, one should examine the `.pods[].cpu.psi` section. Institutions utilizing Prometheus can find the equivalent signal from the kubelet's `/metrics/cadvisor` endpoint under the name `container_pressure_cpu_waiting_seconds_total`.
The experimental setup involved using a kind cluster running on a machine equipped with four CPUs. The worker node was assigned two CPUs, leaving the remaining two for the control plane, thus preventing the control plane from interfering with the test workload. The workload itself consisted of a small pod executing busy loops, with each loop consuming one entire CPU whenever it acquired one. The complete setup details are provided in the appendix. For each run, a sixty-second stabilization period was observed before the node's CPU pressure was sampled twelve times, spaced ten seconds apart; the figures presented below represent the mean of these twelve measurements.
In Run A, a single pod ran two loops, meaning each loop was allocated its own dedicated CPU. The output of `kubectl top nodes` showed the worker consuming 2001m, indicating both CPUs were fully engaged, and the CPU pressure was 0.33%; the loops experienced virtually no waiting. In Run B, three pods initiated six loops, forcing these six processes to contend for the same two CPUs, meaning only two could execute concurrently while the others waited. The `kubectl top nodes` output remained unchanged at 2001m CPU usage, but the CPU pressure spiked to 99.63%, indicating that nearly all the time, some loop was stalled waiting for CPU time. Both runs displayed a CPU(%) of 50%, a discrepancy because Kubernetes tallies all four machine CPUs as the node's total capacity, unaware of the two-CPU restriction imposed. Despite both Runs A and B utilizing the same two cores on the worker node, the CPU pressure shifted dramatically from under 1% to 99.6%. Run C, which utilized only a quarter of the node's capacity, still registered 75.2% pressure. Examining the CPU usage at the individual pod level revealed another layer of complexity: the three pods in Run B consumed between 616m and 708m each, even though each was running two busy loops. These lower figures do not imply a reduced CPU requirement; rather, they reflect the sharing of two CPUs. While `kubectl top` does not reveal the waiting, pod-level PSI indicated that the three pods experienced CPU pressures of 69%, 99.73%, and 99.79% in the final reading.
A test was also conducted to observe system behavior when a workload possesses a CPU limit while the physical node retains available resources. For Run C, the experiment reverted to a single pod with two loops, but its CPU limit was set to 500m. The worker node then utilized approximately 0.51 of its two CPUs, leaving three quarters idle; `kubectl top` displayed 12% utilization because Kubernetes accounted for four total CPUs. Despite this spare capacity, the node's `some.avg10` averaged 75.23%. The 500m restriction capped the pod's CPU consumption, even though the worker node possessed unused capacity. The two loops exhausted their allocated CPU quota and consequently faced throttling, evidenced by the container's throttling counter showing it was throttled 1905 CFS periods since initiation: `container_cpu_cfs_throttled_periods_total{container="spin",...} 1905`. The PSI documentation uses a CPU-limited pod as its example, but here, the throttling counter points to the pod's explicit limit rather than competition from other workloads, meaning that increasing node capacity would not alleviate this pressure as long as the pod's CPU limit remained fixed at 500m.
The three experimental scenarios demonstrate the necessity of examining CPU pressure alongside utilization when troubleshooting performance issues: High utilization coupled with low pressure (Run A) suggests the CPUs are busy but the workload is manageable, meaning utilization alone is not the root cause. Conversely, high utilization paired with high pressure (Run B) signals that there is more runnable work than the CPU can handle; in such instances, operators should investigate other scheduled items on the node, CPU requests, and placement strategies. Finally, pressure observed on a pod when node capacity is available (Run C) strongly suggests the pod is being constrained by its own CPU limit, necessitating a check of throttling counters.
Operators should avoid establishing a universal PSI threshold. A pressure level deemed acceptable for an asynchronous batch job might constitute a critical failure for a latency-sensitive API, therefore, comparison against the workload's established baseline and monitoring whether pressure correlates with latency increases or queue depth are crucial steps. For the inference services under investigation, latency escalation can stem from several sources: increased internal processing time within the service, CPU waiting time, or delays in external service calls. These trials illuminated the value added by PSI. If latency increases without a clear explanation from CPU utilization metrics, checking pod-level CPU pressure allows an operator to determine if contention or throttling might be contributing factors, which should then be cross-referenced with application metrics and traces before any definitive conclusion is drawn.
The appendix details the reproduction steps, which involved using kind v0.33.0 with Kubernetes v1.36.1, the version where PSI metrics became stable. Prerequisites include a Linux host equipped with cgroup v2, a kernel enabling PSI, Docker, kind, kubectl, and jq, all requiring at least four CPUs. Verification of the host environment involves checking `stat -fc %T /sys/fs/cgroup` (expected: `cgroup2fs`) and `cat /proc/pressure/cpu` (expected: lines for `some` and `full`). On macOS, Colima, an open-source tool for running Docker Engine within a Linux VM, was employed: `colima start --profile psi-demo --runtime docker --cpu 4 --memory 8`, followed by executing the checks inside the VM via `colima ssh --profile psi-demo --`. The cluster was established using a provided `kind-config.yaml` file: `kind create cluster --name psi-demo --image kindest/node:v1.36.1 --config kind-config.yaml --wait 180s`. To isolate nodes onto distinct CPUs, Docker commands were used: `docker update --cpuset-cpus="0,1" psi-demo-control-plane` and `docker update --cpuset-cpus="2,3" psi-demo-worker`. Inside the worker container, `docker exec psi-demo-worker nproc` confirmed the two CPU allocation. Because the kind worker operates as a container, its node-level PSI originates from that container's cgroup rather than the host's `/proc/pressure/cpu`; consequently, the system-wide CPU full line in `/proc/pressure/cpu` will always be zero. Metrics-server must be installed for `kubectl top`: `kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/download/v0.8.0/components.yaml`, requiring the `--kubelet-insecure-tls` flag due to kind's self-signed certificates, which should not be used outside local testing. The deployment of metrics-server was then patched: `kubectl -n kube-
Why it matters
For operators managing latency-sensitive services, relying solely on CPU utilization masks critical resource contention issues. PSI provides a deeper diagnostic tool to understand if workloads are stalled waiting for CPU time, even when utilization metrics appear normal. This insight is crucial for tuning resource allocation in complex Kubernetes environments.





