OpsCanary
kubernetesschedulingPractitioner

Diagnosing Resource Contention in Kubernetes with CPU PSI

5 min read Kubernetes BlogDec 1, 2026Reviewed for accuracy
Share
Practitioner — Hands-on experience recommended

In a Kubernetes environment, simply monitoring CPU utilization can lead to misleading conclusions about performance issues. CPU PSI provides deeper insights by measuring how much time tasks are ready to run but are waiting for CPU resources. This metric helps you pinpoint contention and optimize resource allocation, ultimately improving application performance.

Kubernetes exposes PSI metrics through the kubelet starting from version 1.36. You can access these metrics using the kubelet Summary API, which provides a comprehensive view of CPU usage alongside PSI data. The command kubectl get --raw "/api/v1/nodes/<node-name>/proxy/stats/summary" | jq '{cores: (.node.cpu.usageNanoCores / 1e9), psi: .node.cpu.psi}' gives you a clear picture of CPU usage and PSI metrics for each node and pod. This allows you to see not just how much CPU is being used, but also how often tasks are waiting for CPU resources, which is crucial for diagnosing performance bottlenecks.

In production, understanding CPU PSI can significantly enhance your ability to manage workloads effectively. Be aware that you need a Linux host with cgroup v2 and a kernel that has PSI enabled. Also, ensure you have tools like Docker, kind, kubectl, and jq installed, with at least four CPUs available for accurate measurements. Keep in mind the warning about using the --kubelet-insecure-tls flag when deploying the metrics server, as this can expose your cluster to security risks.

Key takeaways

  • →Use CPU PSI to diagnose when tasks are waiting for CPU resources.
  • →Access PSI metrics via the kubelet Summary API for detailed insights.
  • →Ensure your environment meets prerequisites like cgroup v2 and a compatible kernel.

Why it matters

By utilizing CPU PSI, you can proactively identify and resolve resource contention issues, leading to improved application responsiveness and resource efficiency in your Kubernetes clusters.

Code examples

Bash
kubectl get --raw "/api/v1/nodes/<node-name>/proxy/stats/summary" \
| jq '{cores: (.node.cpu.usageNanoCores / 1e9), psi: .node.cpu.psi}'
Bash
cat /proc/pressure/cpu
# expect: some and full lines
Bash
kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/download/v0.8.0/components.yaml
# See the previous warning about the --kubelet-insecure-tls flag!

When NOT to use this

The official docs don't call out specific anti-patterns here. Use your judgment based on your scale and requirements.

Want the complete reference?

Read official docs

Test what you just learned

Quiz questions written from this article

Take the quiz →
Linux FoundationSponsor

Industry-standard certifications built by the people behind Linux and Kubernetes. Earn the CKA — the gold standard Kubernetes administrator cert. OpsCanary readers get 30% off year-round with code OPSCANARY3.

Get CKA certified →

Get the daily digest

One email. 5 articles. Every morning.

No spam. Unsubscribe anytime.