Interview Prep/Linux/Performance & the USE Method

How do you correctly read CPU usage of a process on a multi-core machine?

BeginnerProductionPerformance & the USE Method
Answer

top and ps show per-process %CPU relative to one core by default, so a process using four cores fully shows 400%. Press I in top to toggle Irix mode off, which divides by the number of CPUs. ps %cpu is averaged over the whole process lifetime, not the current rate; use pidstat 1 or top for current usage.

All Linux questions Roadmap: Linux

More on Performance & the USE Method