Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

When I use command mpstat, I see an idle value, for example 25%. It means 75% of CPU power is used.

If there are 4 cores on CPU, then does 25% idle mean that 3 cores are fully used and 1 core is not used at all?

What command shall I use to see the total CPU usage of all cores?

share|improve this question
    
That's not the load average btw. There is a distinction between CPU utilization and the load average. A CPU can only be utilized up to 100%, the load average describes somewhat of a queue of tasks that wait for the CPU. Thus, the queue can grow longer than 100% (which would be full utilization). –  Oliver Salzburg Jul 30 '12 at 10:28

2 Answers 2

25% idle on a four core machine means that the average core was 25% idle. That could mean that three cores were used all the time and one was idle. It could also mean that all four cores were active 75% of the time. It can mean anything in-between.

What command shall I use to see the total CPU usage of all cores?

It's just math. If you have 4 cores and they were 25% idle, the total CPU usage of all cores is

    4 * (1 - 25/100)
or 3.0 -- the equivalent of three cores at 100% usage.

If you want to see individual cores, the easiest way is to run top and then hit the 1 key to show all cores. You can then use H to show threads and f j <enter> to show which core each thread last ran on (the P column).

share|improve this answer

If you want to see the stats for all individual cores, use mpstat -P ALL:

enter image description here

Without -P ALL, you'll get the average of all cores. Displayed in the shown output in the all line.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.