Calculate idle CPU percentage and headroom available for additional workload.
/proc/stat's cpu line reports cumulative ticks in each state (user, nice, system, idle, iowait, irq, softirq, steal) since boot; idle ticks as a fraction of total ticks over a sampling interval gives idle percentage, the complement of overall utilization. Multiplying idle percentage by core count converts a percentage into a concrete 'how many whole cores' worth of unused capacity exists' figure — useful framing for capacity planning and consolidation decisions, since '35% idle on a 32-core box' is a more actionable number when expressed as roughly 11 idle core-equivalents.
Idle percentage and wasted capacity
idle% = idle_ticks / total_ticks × 100; wasted_capacity = (idle% / 100) × cores
Mostly, but with nuance — idle ticks reflect time the CPU had literally nothing scheduled, which is a reasonable proxy for spare capacity for CPU-bound work, but it doesn't account for memory, I/O or network limits that might prevent a workload from actually using that idle CPU time.
Both represent the CPU doing no useful work, but iowait specifically means idle-while-waiting-for-outstanding-I/O, whereas plain idle means genuinely nothing was pending. High iowait alongside low plain-idle suggests I/O is the limiting factor even though the CPU itself isn't computing.
The counters in /proc/stat are cumulative since boot, so a single reading just shows historical totals; sampling twice and taking the delta over a known interval (the same technique tools like `top` and `mpstat` use internally) is required to get a current, meaningful idle percentage.