Site icon New Generation Enterprise Linux

Stop cgroups from hiding your actual CPU usage

Container Basics On Linux (Namespaces/Cgroups)

Stop cgroups from hiding your actual CPU usage

đź§© The Challenge

Dealing with a container that’s acting sluggish even when the host load looks fine is a special kind of hell. I’ve wasted way too much time debugging misconfigured CPU shares only to find out the scheduler is throttling the process way harder than I thought.

đź’ˇ The Fix

You need to peek at the cpu.stat file inside the cgroup v2 hierarchy to see how many times your process actually hit its quota. It’s the only way to know if your application is being throttled or if you’ve just got bad code.

cat /sys/fs/cgroup/system.slice/your-container.service/cpu.stat

⚙️ Why It Works

This file gives you a raw count of how many microseconds the processes inside that group were forced to wait. If the nr_throttled value is climbing, you’ve hit your wall and it’s time to bump those limits up.

🚀 Pro-Tip: Alias this to a quick check command so you aren’t digging through sysfs paths when the site is down.

Linux Tips & Tricks | © ngelinux.com | 7/21/2026

0 0 votes
Article Rating
Exit mobile version