Stop cgroup limits from choking your container processes without a trace
Container Basics On Linux (Namespaces/Cgroups)
Stop cgroup limits from choking your container processes without a trace
🧩 The Challenge
You ever have a container randomly stop doing work, but the process is still technically running? It drove me nuts for an entire weekend until I realized the cgroup CPU throttle was silently starving the thing while top looked totally fine.
💡 The Fix
Check the cpu.stat file inside the cgroup v2 hierarchy to see if your process is actually hitting the hard limit defined by the kernel. It tells you exactly how many microseconds your process has been throttled, which usually points the finger right at your resource constraints.
cat /sys/fs/cgroup/system.slice/your-container-service.service/cpu.stat | grep nr_throttled
⚙️ Why It Works
The nr_throttled counter increments every time the scheduler pauses your task for exceeding its quota in a given window. Once you see that number climbing, you know the kernel is putting the brakes on your app regardless of what your application logs claim.
🚀 Pro-Tip: Set your CPU quota to -1 if you are just testing, but definitely put it back before your neighbor’s noisy process eats your entire core.
Linux Tips & Tricks | © ngelinux.com | 11/17/2026
