Question
A process in my server is reaching CPU usage of 100% or more, should I be concerned?
Answer
Depending on how you are checking the CPU% usage, the values you are seeing will likely be a little misleading. This is especially the case for servers that have multiple CPU cores.
Commands such as "top", by default, will display a higher CPU usage due to how the calculation is performed due to default attributes it uses.
The following is an excerpt from the man page of "top":
1. %CPU -- CPU Usage
In a true SMP environment, if a process is multi-threaded
and top is not operating in Threads mode, amounts greater than 100%
may be reported.
You toggle Threads mode with the `H' interactive command.
Processes that may be threaded, will not accurately display their CPU% usage until "top" is adjusted to account for this.
Furthermore, non-threaded tasks may also be affected simply by having a multi-core system.
Also for multi-processor environments, if Irix mode is Off,
top will operate in Solaris mode where a task's cpu usage will be divided
by the total number of CPUs.
You toggle Irix/Solaris modes with the `I' interactive command.
This means that if your server has 4 CPU cores, the usage reported with "Irix" mode on, will be the usage across all 4 cores.
Example:
Irix Mode On:
Core 0 = 20%
Core 1 = 10%
Core 2 = 5%
Core 3 = 8%
Total Reported CPU% = 43%
However, with Irix mode off, the CPU calculations will be a lot lower since it will be calculated across all 4 CPU cores.
When using "top" to monitor CPU% usage, Irix mode should be off if you have a multi-core system to ensure that the readings reported are easier to understand across all cores.
Here is an external source which discusses this behavior as well.
Comments
0 comments
Article is closed for comments.