What is this “load average” I keep hearing about?


I have been asked numerous times what does “load average” means in top. If you don’t know what top is and you have access to linux machine, go type top now and see what it shows.

load average: 2.05, 2.17, 1.93

Quick answer is: first number (2.05) is 1 minute avg, second number (2.17) is 5 minute avg, third number (1.93) is 15 min avg. Generally system admins look at these #’s to see how is their server is doing. But now you wonder, if this is the #’s you look at, why is there cpu %? Isn’t that computer load also? Ofcourse it is. BUT, meaning of cpu % shown in [ Cpu(s): 14.2% us, 1.7% sy, 0.0% ni, 80.7% id, 3.1% wa, 0.0% hi, 0.3% si, 0.0% st ] actually just means how much % of time was spent doing stuff on cpu. On the other hand, load average takes other things such as how much cpu’s were being used and how many process had to wait for their turn to use cpu, etc. Thats why sometimes you will see high % for Cpu usage but low # for load average because things didn’t get queued much and cpu just spiked a bit at the time you looked at it. You can also have slow responding server with high cpu % and low load average.

So what is ok and what is not ok # to see in load average? This is actually simpler to answer than explaining what is what. For each cpu you add, you add 1 to your high #. For example, if you dual cpu, its ok to see load upto 2. Which basically says both of the cpus were doing 100% of work and its ok. If that # is above 2, lets say 4, that means your system is working twice as hard as it should. So lets say you have dual cpu with hyperthreading, what is the optimial number to see in load average? If you said 4, you are correct!

So now you know! Here are couple other commands which will show you load averages:

w
18:58:26 up 438 days, 13:32, 1 user, load average: 1.83, 2.26, 2.24

uptime
18:58:44 up 438 days, 13:33, 1 user, load average: 1.59, 2.18, 2.21

To learn about the commands used in this post, see man w, man uptime, man top

—————

DISCLAIMER: As always, if you find any inaccurate information, please comment and let me know. When you do comment, make sure you give me some references to confirm.


4 Responses to “ What is this “load average” I keep hearing about? ”

  1. August 12th, 2008 | 1:06 pm

    [...] server.  One of the tools most Linux/Unix admins are used to is called “top”.  “top” by itself is a very powerful tool.  Here is a quick guide on how to ready output from [...]

  2. January 5th, 2009 | 9:27 am

    install help ?

  3. Eduardo Nunes
    January 5th, 2011 | 8:36 pm

    Thank You!

    Finally I understood what load average is about!

  4. May 21st, 2011 | 7:02 am

    Wow, thatÂ’s a really clever way of tinhnkig about it!

Leave a reply

*
To prove that you're not a bot, enter this code
Anti-Spam Image