Stop guessing which cgroup is choking your process
Container Basics On Linux (Namespaces/Cgroups)
Stop guessing which cgroup is choking your process
🧩 The Challenge
You know that feeling when a service is chugging along, but you have zero clue if the kernel is actively throttling it because you hit a cgroup memory limit? I have wasted hours staring at top while the actual answer was buried in the filesystem.
💡 The Fix
Head straight into the cgroup v2 controller directory to see the real-time pressure stalls and current usage stats. It is way more reliable than random system monitoring tools that don’t look deep enough.
grep . /sys/fs/cgroup/system.slice/your-service.service/memory.stat
⚙️ Why It Works
Reading these files directly from the kernel interface gives you the raw truth on how much memory the cgroup is currently consuming and if the OOM killer is even breathing down your neck.
🚀 Pro-Tip: Check memory.pressure to see if your process is actually struggling to get CPU time because it is stuck waiting on memory page allocations.
Linux Tips & Tricks | © ngelinux.com | 11/2/2026
