Stop being blind to why your container is hogging all the CPU

Container Basics On Linux (Namespaces/Cgroups)

Stop being blind to why your container is hogging all the CPU

🧩 The Challenge

Dealing with a container that suddenly hits 100% CPU usage is a nightmare when you have a dozen of them running on the same host. You end up staring at top wondering which container belongs to which cgroup path because everything looks like a random mess of IDs.

💡 The Fix

Use systemd-cgtop to actually see the resource breakdown by slice and container in real-time. It beats guessing which PID belongs to which app by a mile.

systemd-cgtop

⚙️ Why It Works

This tool pulls data directly from the cgroup filesystem and maps the raw metrics back to the systemd units that actually spawned them. It saves you from manually hunting through /sys/fs/cgroup/cpu and matching PIDs to container runtime metadata.

🚀 Pro-Tip: Pipe it into grep if you are hunting a specific service prefix so you don’t get blinded by the kernel threads.

Linux Tips & Tricks | © ngelinux.com | 8/12/2026

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted