cpu usage - Load average and processor count

08
2014-07
  • Joyce Babu

    If I have a CPU with 8 cores, is it okay to have a consistent average load of 2.5? Or should it always remain below 1, irrespective of the number of processors / cores?

  • Answers
  • David Schwartz

    Yes. There is no specific load average that is okay or not okay, and because the load average measures I/O as well as CPU usage, the number of cores is basically irrelevant. If the system is performing acceptably, then it's acceptable. If not, not.


  • Related Question

    What does load average mean in unix/linux?
  • John Fouhy

    If I run uptime, I get something like this:

    10:50:30 up 366 days, 23:27,  1 user,  load average: 1.27, 2.06, 1.54
    

    What do those numbers on the end mean? The man page tells me it's "the load average of the system over the last 1, 5, and 15 minutes.". But what is the scale? Is 1.27 high? Low? Does it depend on my system?


  • Related Answers
  • Ben

    Load average is a gauge of how many processes are on average, concurrently demanding CPU attention.

    Generally, if you have 1 process running at 100%, and it just sits like that for all eternity, you can expect all values to approach '1'.

    Generally, this is as efficient computing as you can get, no losses due to context-switches.

    However, on modern multitasking OS's, there is more than one thing that needs CPU attention, so under a moderate amount of load from a single process, load average should float between 0.8 and 2.

    If you decide to do something insane, like build a kernel with make -j 60, despite only having 1 logical processor, then load average would rush towards 60, and your computer would be incredibly useless to you. ( Death by context switch )

    Also to note, this metric is irrespective of how many cores/cpu's there are. For a 2-cored system, running 1 process that consumes a whole core ( leaving the other idle ) results in a load average of 1.0. In order to decided how loaded a system is, you'll need to know the number of cores and do the division yourself.

  • John T

    In general it measures the number of active processes at a given time, but the metrics used to calculate it differ on some systems. The only article I've found that explains it fairly well is this one.

  • fho

    man 5 proc:

    /proc/loadavg The first three fields in this file are load average figures giving the number of jobs in the run queue (state R) or waiting for disk I/O (state D) aver‐ aged over 1, 5, and 15 minutes. They are the same as the load average numbers given by uptime(1) and other programs.