Question
A process on my server is reaching CPU usage of 100% or more. Is this a cause for concern?
Answer
The CPU percentage (%CPU) displayed by the top command can be misleading on systems with multiple CPU cores due to its different reporting modes.
Irix vs. Solaris Model
The top command has two modes for displaying CPU usage on multi-processor systems, which you can switch between by pressing the I key (Shift+i).
- Irix Mode (On): In this mode, a process's CPU usage is the sum of its usage across all cores. The total can exceed . For example, a process using of one core and of a second core will show a
%CPUof . This value represents the total processing power being used in terms of single-core equivalents. - Solaris Mode (Off): In this mode, a process's total CPU usage is divided by the number of CPU cores. The result is a percentage of the total available CPU power, so the value will not exceed . This is often the default behavior.
Example on a 4-core server:
A process uses 20% on Core 0, 10% on Core 1, 5% on Core 2, and 8% on Core 3.
- Irix Mode On: The reported
%CPUis the sum: . - Solaris Mode On (Irix Off): The reported
%CPUis the total usage divided by the number of cores: .
For assessing a process's impact on the entire system, Solaris mode (Irix mode off) provides a more intuitive percentage of total capacity.
Threading View
Processes that are multi-threaded are the ones that can utilize multiple cores simultaneously, leading to %CPU values greater than in Irix mode. By default, top shows the combined CPU usage for all threads of a single process.
To see the CPU usage of individual threads, you can press the H key (Shift+h). This toggles "Threads mode," which lists each thread as a separate entry.
Comments
0 comments
Article is closed for comments.