Peek inside a containers cgroup constraints without Docker installed
Container Basics On Linux (Namespaces/Cgroups)
Peek inside a containers cgroup constraints without Docker installed
🧩 The Challenge
You’re staring at a process that seems sluggish, but you’re logged into a machine where someone else set up the orchestration and you can’t find the original config files anywhere. It’s infuriating when you know there’s a hard limit being hit, but the system isn’t telling you what it is.
💡 The Fix
Dig directly into the sysfs hierarchy to see exactly what the kernel is enforcing on that process. You don’t need fancy tools to see how much memory or CPU time the container is actually allowed to touch.
cat /sys/fs/cgroup/memory/system.slice/docker-<container-id>.scope/memory.limit_in_bytes
⚙️ Why It Works
The kernel exposes cgroup settings as a virtual filesystem, so you’re just reading raw enforcement values straight from the source of truth. If you find that file and check its contents, you’ll see the exact byte limit imposed by the container runtime.
🚀 Pro-Tip: Use the find command at the /sys/fs/cgroup root if you can’t figure out the exact path for a nested slice.
Linux Tips & Tricks | © ngelinux.com | 10/13/2026
