top_cpu_throttle
The top_cpu_throttle gadget periodically reports cgroup v2 CPU throttling statistics, making it easy to identify which containers, pods, or namespaces are the worst CFS (Completely Fair Scheduler) throttle offenders.
This is particularly useful when PSI (Pressure Stall Information) shows high
CPU pressure on a node but top/htop shows available CPU time — the
pressure is likely caused by too-tight cgroup CPU limits rather than genuine
CPU overutilization.
Getting started
Running the gadget:
- kubectl gadget
- ig
$ kubectl gadget run ghcr.io/inspektor-gadget/gadget/top_cpu_throttle:v0.51.1
$ sudo ig run ghcr.io/inspektor-gadget/gadget/top_cpu_throttle:v0.51.1
Guide
The gadget reads the following cgroup v2 files for every cgroup that has a CPU bandwidth limit:
| File | Data |
|---|---|
cpu.max | Quota and period (the CPU limit) |
cpu.stat | nr_periods, nr_throttled, throttled_usec (cumulative throttle counters) |
cpu.pressure | PSI averages (optional — gracefully skipped if unavailable) |
Reported fields
| Column | Description |
|---|---|
CGROUP | Cgroup v2 path (hidden by default) |
PERIODS | Number of CFS enforcement intervals elapsed in the reporting period |
THROTTLED | Number of times the cgroup was throttled |
THROTTLED_TIME | Total time spent throttled (human-readable duration) |
%THROT | Throttle percentage (THROTTLED / PERIODS × 100, 0–100) |
QUOTA | CPU quota per CFS period (human-readable duration) |
LIMIT | Effective CPU core limit (quota / period) |
%PSI10 | CPU pressure % over 10 s (PSI "some" avg) |
%PSI60 | CPU pressure % over 60 s (PSI "some" avg) |
Only cgroups with an explicit CPU bandwidth limit are shown — cgroups
without a cpu.max quota (i.e., unlimited) are filtered out.
PSI "full" is omitted because CFS throttling is all-or-nothing at the cgroup level — "full" is always identical to "some" for CPU pressure.
All throttle counters are per-interval deltas, not cumulative totals — they reflect what happened since the last report.