Load Average

From Noah.org
Jump to navigationJump to search


What does `uptime` mean?

On a single user, single CPU system that is not doing much you should expect the load average to be around 0.10. Anything below 1.0 is good. If your load hovers around 2.0 all day then you need another CPU or one twice as fast.

Load Average, as given by `uptime`, is the number of processes that are are running or waiting to run in the last minute. The single CPU can only do one thing at a time, so you can think of Load Average as the number of processes that are bumping into each other to get a slice of the CPU. If the load goes above 1.0 then that means that some processes are forced to wait before they can get a turn. Another way to think about it is the number of CPUs you would need to handle the current load. If your Load Average goes to 2.0 then this means the kernel could have handled all requests without forcing anyone to wait if your CPU was twice as fast, or the kernel could have handled all requests without waiting if you had two CPUs. This is a rule of thumb. Load is actually much more complex and differs in different UNIX systems.

Load is not the same as CPU usage. If you have a single process using 99% of the CPU cycles your load will still hover around 1.0. To see a combination of CPU usage and Load Average run `top` or `procinfo`. You might have hundreds of processes open, but most of them should be idle (waiting for something to do or waking up from time to time to do something). Every shell window you have open and even the web browser you are using to read this are not doing much of anything. On my system a `ps ax | wc -l` shows that I have 150 processes open, but my Load Average is 0.13 and my CPU Idle time is 95%, so despite the number of processes my CPU is not working hard at all. For an example of this, run `top` and note all the processes open. Now press 'i'. This hides all the idle processes. You should see only one or two processes now and `top` will likely be one of them.