How to fix PIDPressure in Kubernetes
A Kubernetes node is running out of available process IDs (PIDs). This prevents new Pods and processes from starting, causing resource exhaustion.
Quick fix
Fixes PIDPressure
cat /proc/sys/kernel/pid_max- Check the PID limit on the affected node
- Drain the node and evict excess Pods
- Increase the kernel pid_max if needed
- Identify and remove problematic Pods
cat /proc/sys/kernel/pid_maxPIDPressure
What this error means
Each Linux system has a maximum number of processes (PIDs) it can run. When the number of running processes approaches this limit, Kubernetes marks the node with PIDPressure condition. This is a sign of either too many Pods on the node or processes creating excessive child processes without cleanup.
Typical symptoms
- Node shows "PIDPressure True" in kubectl describe node
- New Pods stay in Pending state
- Existing Pods cannot spawn child processes
- Container logs show "Cannot allocate memory" or "Resource temporarily unavailable"
- Docker/containerd logs show "fork: No space left on device"
- Kubectl commands to that node become slow or timeout
Common causes
- Too many Pods running on a single node (over-packing)
- Runaway process creating zombie child processes
- Kernel pid_max limit set too low
- Memory leaks causing process proliferation
- Container with infinite loop spawning subprocesses
- Node has insufficient resources allocated in kubelet config
How to fix "PIDPressure"
SSH into the node and check the max PID limit:
cat /proc/sys/kernel/pid_maxDefault is usually 32768 or 4194304. A value below 10000 is likely too low.
Safely drain Pods from the affected node:
kubectl drain NODE_NAME --ignore-daemonsets --delete-emptydir-dataThis allows the cluster to reschedule Pods on other nodes.
On the node, increase the PID limit (temporary):
echo 2097152 | sudo tee /proc/sys/kernel/pid_maxFor persistence, add to /etc/sysctl.conf:
kernel.pid_max = 2097152Then apply:
sudo sysctl -pCheck which Pods are consuming the most PIDs:
kubectl top pods -A --sort-by=cpuLook for Pods with unusual process counts. Delete or update them:
kubectl delete pod POD_NAME -n NAMESPACEAfter fixing the issue, uncordon the node:
kubectl uncordon NODE_NAMEMonitor the PIDPressure condition:
kubectl get nodes -w
kubectl describe node NODE_NAME | grep -A5 "Conditions:"The PIDPressure should return to False.
Advanced notes
In Kubernetes 1.24+, you can set per-pod process limits using the pod security policy or resource limits. Consider using process-level monitoring to catch runaway processes early. Use cgroups v2 (cgroup2) for better process isolation. Implement proper Pod eviction policies to prevent over-packing on nodes.
Frequently asked questions
- What does "PIDPressure" mean?
- Each Linux system has a maximum number of processes (PIDs) it can run. When the number of running processes approaches this limit, Kubernetes marks the node with PIDPressure condition. This is a sign of either too many Pods on the node or processes creating excessive child processes without cleanup.
- How do I fix "PIDPressure"?
- A Kubernetes node is running out of available process IDs (PIDs). This prevents new Pods and processes from starting, causing resource exhaustion.
- What causes "PIDPressure"?
- Too many Pods running on a single node (over-packing) Runaway process creating zombie child processes Kernel pid_max limit set too low
- Is the "PIDPressure" error serious?
- Yes. This is a critical-severity error that usually blocks work until it is fixed, but the steps above resolve it.
Official resources & further reading
- ๐Kubernetes Official Documentation
- ๐Kubernetes: Node Pressure Eviction(Official Docs)
- ๐Linux: /proc/sys/kernel/pid_max(Official Docs)
- ๐