One metric to rule them all
Law of Averages
The load average is one of the most iconic system status metrics of the Unix world. It is readily available on any Unix-inspired system and is so pervasive that a multitude of tools provide it – too many to cover here. Yet, it remains a recurring source of user questions. This month, almost as a public service announcement, I will dig head first into the subject.
Arbitrarily, I'll first look at the output of uptime [1] on OS X:
13:03 up 2 days, 12:01, 2 users, load averages: 0.52 0.59 0.63
The uptime command displays the load average in its common form, averaging the last one, five, and 15 minutes of the system's load. A plethora of tools display this metric, which is typically sourced through the getloadavg(3) [2] system call, but the Linux kernel provides a canonical filesystem source for it at /proc/loadavg/ [3]:
1.00 0.97 0.94 1/1279 7743
The three additional numbers provided by Linux are the number of running processes (one in this case), the total number of processes, and the last process ID (PID) used.
When discussing load averages, you need to interpret the term "running" in the narrowest of senses – that is, a process actually executing in the processor at the moment in question. Remember that a multitasking OS provides processes with the illusion of a dedicated CPU.
In reality, however, multiple processes are being continuously swapped in and out of execution on a single processor core using a kernel-specific version of the state machine described in Figure 1.
...Buy this article as PDF
(incl. VAT)
Buy ADMIN Magazine
Subscribe to our ADMIN Newsletters
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Most Popular
Support Our Work
ADMIN content is made possible with support from readers like you. Please consider contributing when you've found an article to be beneficial.

