Site icon New Generation Enterprise Linux

Stop wondering which cgroup is eating your server memory

Container Basics On Linux (Namespaces/Cgroups)

Stop wondering which cgroup is eating your server memory

🧩 The Challenge

You look at top and see a process hogging RAM, but it’s just a generic container ID string and you have no idea which actual service is responsible. I’ve wasted half a morning digging through container inspect output just to find the wrong process.

💡 The Fix

Check the cgroup paths directly in the proc filesystem to map that PID to a human-readable service name. It saves you from guessing which container engine configuration is actually applying the memory limit.

cat /proc/$(pgrep -u appuser my-web-app)/cgroup

⚙️ Why It Works

The kernel keeps a record of the hierarchy for every process in that file, and listing it reveals the slice and service unit names assigned by systemd. Everything you need to see which cgroup slice the scheduler is enforcing is right there in the path.

🚀 Pro-Tip: Pipe that into cut -d/ -f3 to strip away the noise and get just the unit name.

Linux Tips & Tricks | © ngelinux.com | 10/30/2026

0 0 votes
Article Rating
Exit mobile version