What does load average mean on Unix/Linux?

69

17

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?

John Fouhy

Posted 2009-08-16T23:03:46.490

Reputation: 2 995

1

I found this blog really useful: Understanding Linux CPU Load

– atmaish – 2014-09-13T14:48:46.313

2I wonder how the load average should be interpreted on a multi-core CPU system. – None – 2009-08-16T23:23:27.567

3As a general rule of thumb, you should divide the load average by the number of CPUs for multi core systems. So a load of 2.0 on a dual core system is roughly equivalent to a 1.0 on a single core system. This isn't totally true, because of things like disk I/O and network traiffic, but load is kind of a rought estimate anyways. – Mike Cooper – 2012-06-19T02:54:54.710

Answers

60

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

Generally, if you have one 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 one 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/CPUs there are. For a two-cored system, running one process that consumes a whole core (leaving the other idle) results in a load average of 1.0. In order to decide how loaded a system is, you'll need to know the number of cores and do the division yourself.

Kent Fredric

Posted 2009-08-16T23:03:46.490

Reputation: 1 446

1So for an n-cored system, a load average of n means that each core is/was handling a process 100% of the time and is therefore most efficient? – joshreesjones – 2014-09-19T17:38:04.690

1So a load average of less than 1 means "Processes generally never have to wait"? Can I interpret a load average of 2 as "Each process is taking roughly twice as long as it would in ideal conditions"? (I know that there's I/O to worry about as well) – John Fouhy – 2009-08-16T23:50:43.007

Yes, That makes sense, ignoring IO that is ;) – Kent Fredric – 2009-08-22T11:35:38.107

@KentFredric "Generally, this is as efficient computing as you can get, no losses due to context-switches."...is 1 process running at 100% all the time efficient at all? Surely I am missing something fundamental here. Could you please explain what you meant? I am confused as how can one process hogging all the cpu resources be described as efficient? – Geek – 2013-09-21T07:18:57.227

@Geek Because context switching ( alternating between processes ) is not "free", so 2 processes on one CPU running at 50% each will lose a bit of efficiency due to the context switching. Which means that 1 process at 100% means that process completes as-soon-as-possible in the process of completing its task, and no additional effort is wasted other than completing the task itself. – Kent Fredric – 2013-11-10T13:46:00.540

2I know a process running at 100% doesn't sound very "efficient", but if the process arbitrarily limited itself to use only 20%, it would take 5 times as long. So here efficiency means "optimal resource utilization". – Kent Fredric – 2013-11-10T13:48:35.557

9

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.

fho

Posted 2009-08-16T23:03:46.490

Reputation: 191

3

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.

John T

Posted 2009-08-16T23:03:46.490

Reputation: 149 037

Your link still works and their terminal output is from 2001 How awesome – MS Berends – 2019-05-28T17:50:55.020

2That link is dated '03. Linux 2.6 came out since then. ( You'll note they're using 2.0 , Ouch.) The metrics appear to be now somewhat different in practice than the ones stated on that page. – Kent Fredric – 2009-08-16T23:27:11.393

Here's one from end of '06, which isn't that different from the linked article: http://www.linuxjournal.com/article/9001

– None – 2009-08-17T07:01:28.867

2

I cite from a reference of a course:

Load average is the average of the load number for a given period of time. It takes into account processes that are:

  • Actively running on a CPU.
  • Considered runnable, but waiting for a CPU to become available.
  • Sleeping: i.e., waiting for some kind of resource (typically, I/O) to become available.

I cite further about interpreting load average:

The load average is displayed using three different sets of numbers, as shown in the following example:

The last piece of information is the average load of the system. Assuming our system is a single-CPU system, the 0.25 means that for the past minute, on average, the system has been 25% utilized. 0.12 in the next position means that over the past 5 minutes, on average, the system has been 12% utilized; and 0.15 in the final position means that over the past 15 minutes, on average, the system has been 15% utilized. If we saw a value of 1.00 in the second position, that would imply that the single-CPU system was 100% utilized, on average, over the past 5 minutes; this is good if we want to fully use a system. A value over 1.00 for a single-CPU system implies that the system was over-utilized: there were more processes needing CPU than CPU was available.

If we had more than one CPU, say a quad-CPU system, we would divide the load average numbers by the number of CPUs. In this case, for example, seeing a 1 minute load average of 4.00 implies that the system as a whole was 100% (4.00/4) utilized during the last minute.

Short term increases are usually not a problem. A high peak you see is likely a burst of activity, not a new level. For example, at start up, many processes start and then activity settles down. If a high peak is seen in the 5 and 15 minute load averages, it would may be cause for concern.

Ely

Posted 2009-08-16T23:03:46.490

Reputation: 150

It'd be handy to add a link to your reference. – Pierz – 2017-01-26T10:42:30.557

That's difficult. It's an online course from the Linux Foundation to prepare for the LFCS exam. – Ely – 2017-01-26T11:44:09.930