Live
Consolidating State Health Agency Workflows with Gemini Agent SkillsAI agent database load: patterns, pitfalls, and ScyllaDB mitigationsAI agents for healthcare: deployment patterns and operational impact for cloud and DevOps teamsDesigning an Agent‑Ready Platform: Webflow’s Blueprint for Safe AI‑Generated CodeSelf‑service scaling to 5,000 GKE nodes in under five minutesStable Kubernetes Foundations Power AI Agent Workloads on Amazon EKSObject‑Level RBAC in Basin Catalog: Granular Permissions for EngineersEvidence‑Driven Trustworthy AI Models: What Engineers Need to Adjust TodayConsolidating State Health Agency Workflows with Gemini Agent SkillsAI agent database load: patterns, pitfalls, and ScyllaDB mitigationsAI agents for healthcare: deployment patterns and operational impact for cloud and DevOps teamsDesigning an Agent‑Ready Platform: Webflow’s Blueprint for Safe AI‑Generated CodeSelf‑service scaling to 5,000 GKE nodes in under five minutesStable Kubernetes Foundations Power AI Agent Workloads on Amazon EKSObject‑Level RBAC in Basin Catalog: Granular Permissions for EngineersEvidence‑Driven Trustworthy AI Models: What Engineers Need to Adjust Today
Kubernetes

Seeing Through CPU Utilization: How Kubernetes PSI Exposes Hidden Contention

AI SummaryPowered by AI

Kubernetes now publishes Linux Pressure Stall Information (PSI) for CPU, showing the fraction of time tasks wait for CPU even when utilization is at 100%. This lets AI, platform, and SRE engineers detect contention that raw CPU percentages hide, enabling more accurate performance troubleshooting.

Starting with Kubernetes v1.36, the kubelet adds Linux PSI metrics for CPU, giving operators a view of how often runnable tasks are stalled for CPU time. For latency‑sensitive AI inference or any high‑throughput service, the difference between a fully busy core and a core that is constantly queuing work is critical, and PSI makes that difference observable.

Understanding CPU Pressure

CPU pressure is reported as the some field, which represents the share of time that at least one task was ready but could not run because the CPU was busy. The kernel aggregates this into three sliding windows: avg10, avg60, and avg300. Practitioners typically look at avg10 because it reacts quickly to workload changes. A value of 25% in avg10 means that, over the last ten seconds, some task was waiting a quarter of the time.

Why Utilization Alone Is Misleading

Utilization reports the fraction of CPU cycles that were actually executed. In a two‑CPU node, a workload that drives both cores to 100% will show 2000m (or 2 cores) of usage. However, two very different scenarios can produce the same number:

  • Two pods, each running a single busy loop, each pinned to its own core – minimal waiting.
  • Six pods, each running a busy loop, all competing for the same two cores – most loops spend time waiting.

Both cases report ~2000m usage, but PSI distinguishes them: the first run recorded a some avg10 of 0.33%, while the second run recorded 99.63%.

Collecting PSI Data in Kubernetes

The kubelet exposes PSI through the Summary API and the cAdvisor metrics endpoint. A quick way to fetch node‑level values is:

kubectl get --raw "/api/v1/nodes//proxy/stats/summary" | \
  jq '{cores: (.node.cpu.usageNanoCores / 1e9), psi: .node.cpu.psi}'

Per‑pod and per‑container values appear under .pods[].cpu.psi. When Prometheus scrapes /metrics/cadvisor, the metric container_pressure_cpu_waiting_seconds_total provides the same data.

Implications for Architecture and Operations

Seeing high CPU pressure despite full utilization signals that the node is over‑committed. For AI inference services, this can translate directly into increased latency or missed SLAs. Architects may need to:

  • Adjust pod CPU requests/limits to reflect actual contention.
  • Introduce pod‑level QoS or priority classes to protect latency‑critical workloads.
  • Scale out the workload to additional nodes rather than relying on a single saturated node.

From an operational standpoint, alerts based solely on CPU percentage can miss these scenarios. Adding a PSI‑based alert—e.g., trigger when container_pressure_cpu_waiting_seconds_total{instance="..."} exceeds a threshold over the last 10 seconds—provides early warning of hidden bottlenecks.

Related CloudNinjas coverage: Kubernetes.

What This Means For Practitioners

When you see a node reporting 100% CPU usage, check the some avg10 PSI value. A low number confirms that the workload is well‑matched to the available cores; a high number indicates queuing and likely latency impact. Incorporate PSI into your observability stack, tune resource requests accordingly, and consider scaling or priority adjustments before latency symptoms appear.

Originally published atKubernetes Blog