NodePIDPressure
KubernetesERRORCommonNodeHIGH confidence

Node is under PID pressure — too many processes running

Production Risk

High — PID exhaustion can cause all pods on the node to fail to spawn new processes, leading to widespread pod failures.

What this means

The node's kubelet has detected that the number of running processes is approaching or has exceeded the configured PID threshold. The node is tainted with node.kubernetes.io/pid-pressure and new pods will not be scheduled on it. Existing pods may be evicted.

Why it happens
  1. 1A container has a PID leak — spawning child processes without cleaning them up.
  2. 2kernel.pid_max on the node is set too low for the workload density.
  3. 3No per-pod PID limit is configured, allowing a single pod to exhaust node PIDs.
  4. 4High-concurrency workloads (e.g. forks per request) running on a densely packed node.
How to reproduce

Node condition PIDPressure becomes True; kubelet logs show eviction threshold crossed.

trigger — this will error
trigger — this will error
kubectl describe node my-node | grep -A 5 "Conditions:"
# PIDPressure   True

kubectl get events --field-selector reason=EvictionThresholdMet

expected output

Conditions:
  Type          Status  Reason
  PIDPressure   True    KubeletHasSufficientPID

Fix 1

Identify the PID-leaking container

WHEN PIDPressure appeared suddenly on one node

Identify the PID-leaking container
# On the node, list top PID consumers
ps aux --sort=-%cpu | head -20

# Or via kubectl exec into suspect pods
kubectl exec -it my-pod -- ps aux | wc -l

Why this works

Finding which process tree is the source lets you target the fix at the specific container or application.

Fix 2

Set per-pod PID limits via kubelet configuration

WHEN No PID limits are currently enforced

Set per-pod PID limits via kubelet configuration
# kubelet config (kubelet-config.yaml)
podPidsLimit: 1024

Why this works

podPidsLimit caps the total PIDs a single pod can consume, preventing one misbehaving pod from exhausting the node.

Fix 3

Increase kernel.pid_max on the node

WHEN Node is legitimately running many processes and the limit is too conservative

Increase kernel.pid_max on the node
sysctl -w kernel.pid_max=4194304
# Make persistent:
echo "kernel.pid_max = 4194304" >> /etc/sysctl.d/99-pid.conf

Why this works

Raising pid_max increases the system-wide process limit. Only do this after confirming there is no PID leak.

What not to do

Version notes
Kubernetes 1.10

PID-based eviction and PIDPressure node condition introduced.

Sources
Official documentation ↗

Kubernetes Documentation — Node Pressure Eviction: PID Pressure

Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev

← All Kubernetes errors