How to fix PIDPressure in Kubernetes

KubernetesADVANCEDCRITICALUpdated Dec 6, 2025ยท 139 views

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
  1. Check the PID limit on the affected node
  2. Drain the node and evict excess Pods
  3. Increase the kernel pid_max if needed
  4. Identify and remove problematic Pods
kubernetes โ€” error
cat /proc/sys/kernel/pid_max
PIDPressure

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

  1. Too many Pods running on a single node (over-packing)
  2. Runaway process creating zombie child processes
  3. Kernel pid_max limit set too low
  4. Memory leaks causing process proliferation
  5. Container with infinite loop spawning subprocesses
  6. Node has insufficient resources allocated in kubelet config

How to fix "PIDPressure"

1Check the PID limit on the affected node

SSH into the node and check the max PID limit:

bash
cat /proc/sys/kernel/pid_max

Default is usually 32768 or 4194304. A value below 10000 is likely too low.

2Drain the node and evict excess Pods

Safely drain Pods from the affected node:

bash
kubectl drain NODE_NAME --ignore-daemonsets --delete-emptydir-data

This allows the cluster to reschedule Pods on other nodes.

3Increase the kernel pid_max if needed

On the node, increase the PID limit (temporary):

bash
echo 2097152 | sudo tee /proc/sys/kernel/pid_max

For persistence, add to /etc/sysctl.conf:

bash
kernel.pid_max = 2097152

Then apply:

bash
sudo sysctl -p
4Identify and remove problematic Pods

Check which Pods are consuming the most PIDs:

bash
kubectl top pods -A --sort-by=cpu

Look for Pods with unusual process counts. Delete or update them:

bash
kubectl delete pod POD_NAME -n NAMESPACE
5Uncordon the node and monitor

After fixing the issue, uncordon the node:

bash
kubectl uncordon NODE_NAME

Monitor the PIDPressure condition:

bash
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