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.

What is the command to see CPU load of a RedHat Linux server?

share|improve this question

2 Answers 2

Personally I think looking at the average load of a period is best. Otherwise you might get quite different values depending on the timing. (e.g. enter a command and press [Enter] might yield a different result than if you pressed [Enter] a fraction of a second later.)

Some ways of checking the load average are:

  1. cat /proc/loadavg

    beetle:/proc>cat loadavg
    0.45 0.19 0.13 1/263 17588

  2. uptime also shows the load.

    toad:/home/hennes>uptime
    4:03PM  up 155 days, 19:12, 38 users, load averages: 0.16, 0.17, 0.12

  3. Via top. Look at he line load averages: in the upper right corner.

  4. htop

  5. mpstat

  6. systat (e.g. systat -vmstat)


Most of these programs give you three numbers:

  • The load average during the last minute.
  • The load average during the last five minutes
  • The load average during the last fifteen minutes.

If you have one core then a load of 1 more or less indicates that core is busy 100% of the time. This number can exceed 1 (or 100%). If that happens there is on average more then one process in the run queue.

If you have multiple CPU's then 100% (or 1.00) means that one average one core is busy all the time. E.g. with 4 core this could mean 1 core running flat out and 3 cores being idle. Or 4 cores running ¼ of the time.

share|improve this answer
    
Thanks, load average 0.45 means: 45% of CPU power is used? –  alwbtc Jul 30 '12 at 9:57
    
0.45 means that 45 of a single CPU core is used. 45% used, 55% idle. ---- If you have two core and get a load of 0.45 then 45% of a core is used and 155% is idle ; or both core are used 22.5% of the time and both core are idle 77.5% of the time. –  Hennes Jul 30 '12 at 12:19

top - The classic approach

enter image description here

htop - The colorful approach

enter image description here

mpstat - The plain and simple

enter image description here

Notes

If you're wondering how to read the CPU load from the output of top or mpstat, please look at the idle values they print. The CPU load is the difference between 100% and the displayed value.

If you think that that's weird, please see our question: How is the percentage of CPU usage calculated?

share|improve this answer
    
Thanks, but it gives cpu load per process. I want to see total CPU load, for example 85% –  alwbtc Jul 29 '12 at 13:55
    
If you look at the top line in the first image (program top). It has the line load average. The three values after that are the load average over time. –  Hennes Jul 29 '12 at 14:06
1  
@alwbtc: They all give you that in various forms. If you look at the output of mpstat you see an idle value of 99.24. This means I have a CPU load of 0.76%. As @Hennes notes, there is also the load average displayed, which is another indicator of CPU load. If you really only want a command that returns a single percent value, you'll probably want to post-process the output of mpstat. –  Oliver Salzburg Jul 29 '12 at 14:17
1  
+1 for helpful images! –  BrianAdkins Jul 29 '12 at 14:30

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.