Beyond CPU Utilization: Using PSI to Diagnose Kubernetes Resource Contention
Linux Pressure Stall Information (PSI), exposed by the kubelet and stable in Kubernetes v1.36, shows whether workloads are waiting for CPU, which utilization alone cannot reveal. On a two-CPU kind worker, two busy loops and six busy loops both showed 2001m in kubectl top, but CPU pressure (some avg10) was 0.33% versus 99.63%. A pod with a 500m CPU limit used only a quarter of the node yet showed 75% pressure, and CFS throttling counters confirmed the cause was its own limit, not node contention. The recommended approach is to read PSI alongside utilization and throttling metrics, compare against each workload's baseline instead of fixed thresholds, and confirm against latency and traces.
Related posts
- Kubernetes v1.36: PSI Metrics for Kubernetes Graduates to GA
Kubernetes Blog mediumAdeptPressure Stall Information (PSI) metrics in the kubelet are generally available in Kubernetes v1.36, exposing CPU, memory and I/O stall time at node, pod and container level with no feature gate needed. SIG Node measured overhead on 4-core nodes running 80+ pods: kubelet collection was indistinguishable from baseline, and kernel PSI tracking cost roughly 0.04–0.125 cores (about 1–3% of the node), with one brief spike to 0.225 cores. Since beta, the kubelet checks cgroup configuration for OS-level PSI support and no longer emits misleading zero values on nodes booted with psi=0. Using the metrics requires Linux 4.20+, cgroup v2 and CONFIG_PSI; they are scraped from /metrics/cadvisor or read via the Summary API.
- Breaking down CPU speed: How utilization impacts performance
GitHub Engineering mediumAdeptRising CPU utilization measurably slows request processing on GitHub's Intel-based Kubernetes nodes. Experiments on the Large Unicorn Collider environment held production traffic constant while the `stress` tool drove up utilization. Two effects explain it. Turbo Boost frequencies fall once utilization passes about 30%, and Hyper-Threading sibling contention appears at higher loads. GitHub uses the resulting curves to pick a 'golden ratio' utilization target for a given latency budget, for example 61% utilization for under 40% P50 CPU-time degradation. An outlier instance type turned out to have CPU C-states disabled, which blocked Turbo Boost, and enabling them brought it in line with the others.
- Why Is My Kubernetes Job Still Pending? Tracing Kueue Admission with Headlamp
Kubernetes Blog mediumAdeptA pending Job in a Kueue-managed cluster is often waiting on Kueue admission, not kube-scheduler, so troubleshooting should start with the Workload's QuotaReserved and Admitted conditions before looking at Pods. The read-only 0.1.0-alpha Kueue plugin for Headlamp lets you follow links from a Workload through its LocalQueue, ClusterQueue, ResourceFlavor and Cohort to compare total PodSet requests against quota, borrowing limits and policy. In the worked example, a three-Pod, three-CPU Job stays suspended because its ClusterQueue offers only two CPUs and two Pod slots. The rule of thumb: if the Workload is not admitted, inspect Kueue resources; if it is admitted but Pods are Pending, switch to Job and Pod events for scheduler issues.
- Performance testing: Where benchmarks meet reality
Red Hat Developer mediumAdeptKube-burner performance tests on a customized OpenShift cluster showed that cluster-density workloads met expectations, but node-density tests had unusually high PodInitialized latency even though scheduling looked healthy. Image pulls were ruled out first. Running with --gc=false preserved pods and namespace events, which surfaced 127 Cilium 429 putEndpointIdTooManyRequests errors during pod sandbox creation. Lowering kube-burner's --qps and --burst from 20 to 5 eliminated the errors and cut initialization latency from 45s to 21s, still above the 15s SLO, pointing to the custom CNI as the bottleneck. Much of the remaining text promotes Red Hat Consulting and TAM services.
- Node.js and the tale of worker threads
Zalando Engineering mediumAdeptA Node.js service using cluster mode called os.cpus().length inside a Kubernetes container, which returns the host's core count, not the pod's CPU allocation. On a 48-core node it forked 48 processes inside a 2GB pod. Each needed about 120MB, so the processes were killed under memory pressure and immediately re-forked by the exit handler, flooding a translation service with startup requests (1,000 to 20,000 rpm) and causing cancelled connections and read timeouts. The initial diagnosis of a retry feedback loop caused by process.exit() on fetch failure turned out to be wrong. The fix was to drop cluster mode and let Kubernetes handle scaling, and the incident motivated adding event-loop lag and other signals through an internal Node.js observability SDK.