Site icon New Generation Enterprise Linux

Stop playing hide and seek with your container processes

Container Basics On Linux (Namespaces/Cgroups)

Stop playing hide and seek with your container processes

đź§© The Challenge

Trying to figure out what a container is actually doing from the host side is a nightmare when you have a hundred namespaces running at once. I’ve wasted hours grepping ps output just to find the process that’s eating all my CPU in a container I didn’t even name properly.

đź’ˇ The Fix

Use lsns to map out your namespace architecture so you can see exactly which PID is lurking in which environment. It’s way better than blindly guessing which container is causing the noise.

lsns -t mnt -o NS,NPROCS,PID,COMMAND

⚙️ Why It Works

By filtering specifically for the mount namespace, you get a clean view of every isolated environment currently sitting on your host. Seeing the process count next to the namespace ID makes it obvious which containers are doing actual work versus which ones are just sitting idle.

🚀 Pro-Tip: Pipe it into grep if you are hunting for a specific container ID by its unique mount namespace hex code.

Linux Tips & Tricks | © ngelinux.com | 11/16/2026

0 0 votes
Article Rating
Exit mobile version