<s>
In	O
UNIX	B-Application
computing	O
,	O
the	O
system	B-Operating_System
load	I-Operating_System
is	O
a	O
measure	O
of	O
the	O
amount	O
of	O
computational	O
work	O
that	O
a	O
computer	O
system	O
performs	O
.	O
</s>
<s>
The	O
load	B-Operating_System
average	I-Operating_System
represents	O
the	O
average	O
system	B-Operating_System
load	I-Operating_System
over	O
a	O
period	O
of	O
time	O
.	O
</s>
<s>
It	O
conventionally	O
appears	O
in	O
the	O
form	O
of	O
three	O
numbers	O
which	O
represent	O
the	O
system	B-Operating_System
load	I-Operating_System
during	O
the	O
last	O
one-	O
,	O
five-	O
,	O
and	O
fifteen-minute	O
periods	O
.	O
</s>
<s>
All	O
Unix	B-Application
and	O
Unix-like	O
systems	O
generate	O
a	O
dimensionless	O
metric	O
of	O
three	O
"	O
load	B-Operating_System
average	I-Operating_System
"	O
numbers	O
in	O
the	O
kernel	B-Operating_System
.	O
</s>
<s>
Users	O
can	O
easily	O
query	O
the	O
current	O
result	O
from	O
a	O
Unix	B-Application
shell	I-Application
by	O
running	O
the	O
uptime	B-Device
command	O
:	O
</s>
<s>
The	O
w	B-Device
and	O
top	B-Device
commands	I-Device
show	O
the	O
same	O
three	O
load	B-Operating_System
average	I-Operating_System
numbers	O
,	O
as	O
do	O
a	O
range	O
of	O
graphical	B-Application
user	I-Application
interface	I-Application
utilities	O
.	O
</s>
<s>
In	O
Linux	B-Application
,	O
they	O
can	O
also	O
be	O
accessed	O
by	O
reading	O
the	O
/proc/loadavg	O
file	O
.	O
</s>
<s>
An	O
idle	O
computer	O
has	O
a	O
load	O
number	O
of	O
0	O
(	O
the	O
idle	O
process	B-Operating_System
is	O
not	O
counted	O
)	O
.	O
</s>
<s>
Each	O
process	B-Operating_System
using	O
or	O
waiting	O
for	O
CPU	B-General_Concept
(	O
the	O
ready	O
queue	O
or	O
run	B-Application
queue	I-Application
)	O
increments	O
the	O
load	O
number	O
by	O
1	O
.	O
</s>
<s>
Each	O
process	B-Operating_System
that	O
terminates	O
decrements	O
it	O
by	O
1	O
.	O
</s>
<s>
Most	O
UNIX	B-Application
systems	I-Application
count	O
only	O
processes	O
in	O
the	O
running	O
(	O
on	O
CPU	B-General_Concept
)	O
or	O
runnable	O
(	O
waiting	O
for	O
CPU	B-General_Concept
)	O
states	B-Operating_System
.	O
</s>
<s>
However	O
,	O
Linux	B-Application
also	O
includes	O
processes	O
in	O
uninterruptible	O
sleep	O
states	B-Operating_System
(	O
usually	O
waiting	O
for	O
disk	B-Device
activity	O
)	O
,	O
which	O
can	O
lead	O
to	O
markedly	O
different	O
results	O
if	O
many	O
processes	O
remain	O
blocked	O
in	O
I/O	B-General_Concept
due	O
to	O
a	O
busy	O
or	O
stalled	O
I/O	B-General_Concept
system	O
.	O
</s>
<s>
This	O
,	O
for	O
example	O
,	O
includes	O
processes	O
blocking	O
due	O
to	O
an	O
NFS	B-Protocol
server	O
failure	O
or	O
too	O
slow	O
media	B-General_Concept
(	O
e.g.	O
,	O
USB	B-Protocol
1.x	O
storage	O
devices	O
)	O
.	O
</s>
<s>
Such	O
circumstances	O
can	O
result	O
in	O
an	O
elevated	O
load	B-Operating_System
average	I-Operating_System
which	O
does	O
not	O
reflect	O
an	O
actual	O
increase	O
in	O
CPU	B-General_Concept
use	O
(	O
but	O
still	O
gives	O
an	O
idea	O
of	O
how	O
long	O
users	O
have	O
to	O
wait	O
)	O
.	O
</s>
<s>
Systems	O
calculate	O
the	O
load	B-Operating_System
average	I-Operating_System
as	O
the	O
exponentially	O
damped/weighted	O
moving	O
average	O
of	O
the	O
load	O
number	O
.	O
</s>
<s>
The	O
three	O
values	O
of	O
load	B-Operating_System
average	I-Operating_System
refer	O
to	O
the	O
past	O
one	O
,	O
five	O
,	O
and	O
fifteen	O
minutes	O
of	O
system	O
operation	O
.	O
</s>
<s>
Mathematically	O
speaking	O
,	O
all	O
three	O
values	O
always	O
average	O
all	O
the	O
system	B-Operating_System
load	I-Operating_System
since	O
the	O
system	O
started	O
up	O
.	O
</s>
<s>
Hence	O
,	O
the	O
1-minute	O
load	B-Operating_System
average	I-Operating_System
consists	O
of	O
63%	O
(	O
more	O
precisely	O
:	O
1	O
-	O
1/e	O
)	O
of	O
the	O
load	O
from	O
the	O
last	O
minute	O
and	O
37%	O
(	O
1/e	O
)	O
of	O
the	O
average	O
load	O
since	O
start	O
up	O
,	O
excluding	O
the	O
last	O
minute	O
.	O
</s>
<s>
For	O
the	O
5	O
-	O
and	O
15-minute	O
load	B-Operating_System
averages	I-Operating_System
,	O
the	O
same	O
63%	O
/37	O
%	O
ratio	O
is	O
computed	O
over	O
5	O
minutes	O
and	O
15	O
minutes	O
respectively	O
.	O
</s>
<s>
Therefore	O
,	O
it	O
is	O
not	O
technically	O
accurate	O
that	O
the	O
1-minute	O
load	B-Operating_System
average	I-Operating_System
only	O
includes	O
the	O
last	O
60	O
seconds	O
of	O
activity	O
,	O
as	O
it	O
includes	O
37%	O
of	O
the	O
activity	O
from	O
the	O
past	O
,	O
but	O
it	O
is	O
correct	O
to	O
state	O
that	O
it	O
includes	O
mostly	O
the	O
last	O
minute	O
.	O
</s>
<s>
For	O
single-CPU	O
systems	O
that	O
are	O
CPU	B-General_Concept
bound	O
,	O
one	O
can	O
think	O
of	O
load	B-Operating_System
average	I-Operating_System
as	O
a	O
measure	O
of	O
system	O
utilization	O
during	O
the	O
respective	O
time	O
period	O
.	O
</s>
<s>
For	O
example	O
,	O
one	O
can	O
interpret	O
a	O
load	B-Operating_System
average	I-Operating_System
of	O
"	O
1.73	O
0.60	O
7.98	O
"	O
on	O
a	O
single-CPU	O
system	O
as	O
:	O
</s>
<s>
during	O
the	O
last	O
minute	O
,	O
the	O
system	O
was	O
overloaded	O
by	O
73%	O
on	O
average	O
(	O
1.73	O
runnable	O
processes	O
,	O
so	O
that	O
0.73	O
processes	O
had	O
to	O
wait	O
for	O
a	O
turn	O
for	O
a	O
single	O
CPU	B-General_Concept
system	O
on	O
average	O
)	O
.	O
</s>
<s>
during	O
the	O
last	O
5	O
minutes	O
,	O
the	O
CPU	B-General_Concept
was	O
idling	O
40%	O
of	O
the	O
time	O
on	O
average	O
.	O
</s>
<s>
during	O
the	O
last	O
15	O
minutes	O
,	O
the	O
system	O
was	O
overloaded	O
698%	O
on	O
average	O
(	O
7.98	O
runnable	O
processes	O
,	O
so	O
that	O
6.98	O
processes	O
had	O
to	O
wait	O
for	O
a	O
turn	O
for	O
a	O
single	O
CPU	B-General_Concept
system	O
on	O
average	O
)	O
.	O
</s>
<s>
This	O
means	O
that	O
this	O
system	O
(	O
CPU	B-General_Concept
,	O
disk	B-Device
,	O
memory	O
,	O
etc	O
.	O
)	O
</s>
<s>
In	O
a	O
system	O
with	O
four	O
CPUs	O
,	O
a	O
load	B-Operating_System
average	I-Operating_System
of	O
3.73	O
would	O
indicate	O
that	O
there	O
were	O
,	O
on	O
average	O
,	O
3.73	O
processes	O
ready	O
to	O
run	O
,	O
and	O
each	O
one	O
could	O
be	O
scheduled	O
into	O
a	O
CPU	B-General_Concept
.	O
</s>
<s>
On	O
modern	O
UNIX	B-Application
systems	I-Application
,	O
the	O
treatment	O
of	O
threading	B-Operating_System
with	O
respect	O
to	O
load	B-Operating_System
averages	I-Operating_System
varies	O
.	O
</s>
<s>
Some	O
systems	O
treat	O
threads	B-Operating_System
as	O
processes	O
for	O
the	O
purposes	O
of	O
load	B-Operating_System
average	I-Operating_System
calculation	O
:	O
each	O
thread	B-Operating_System
waiting	O
to	O
run	O
will	O
add	O
1	O
to	O
the	O
load	O
.	O
</s>
<s>
However	O
,	O
other	O
systems	O
,	O
especially	O
systems	O
implementing	O
so-called	O
M:N	O
threading	B-Operating_System
,	O
use	O
different	O
strategies	O
such	O
as	O
counting	O
the	O
process	B-Operating_System
exactly	O
once	O
for	O
the	O
purpose	O
of	O
load	O
(	O
regardless	O
of	O
the	O
number	O
of	O
threads	B-Operating_System
)	O
,	O
or	O
counting	O
only	O
threads	B-Operating_System
currently	O
exposed	O
by	O
the	O
user-thread	O
scheduler	O
to	O
the	O
kernel	B-Operating_System
,	O
which	O
may	O
depend	O
on	O
the	O
level	O
of	O
concurrency	O
set	O
on	O
the	O
process	B-Operating_System
.	O
</s>
<s>
Linux	B-Application
appears	O
to	O
count	O
each	O
thread	B-Operating_System
separately	O
as	O
adding	O
1	O
to	O
the	O
load	O
.	O
</s>
<s>
reported	O
that	O
CPU	B-General_Concept
load	O
information	O
based	O
upon	O
the	O
CPU	B-General_Concept
queue	O
length	O
does	O
much	O
better	O
in	O
load	O
balancing	O
compared	O
to	O
CPU	B-General_Concept
utilization	O
.	O
</s>
<s>
The	O
reason	O
CPU	B-General_Concept
queue	O
length	O
did	O
better	O
is	O
probably	O
because	O
when	O
a	O
host	O
is	O
heavily	O
loaded	O
,	O
its	O
CPU	B-General_Concept
utilization	O
is	O
likely	O
to	O
be	O
close	O
to	O
100%	O
and	O
it	O
is	O
unable	O
to	O
reflect	O
the	O
exact	O
load	O
level	O
of	O
the	O
utilization	O
.	O
</s>
<s>
In	O
contrast	O
,	O
CPU	B-General_Concept
queue	O
lengths	O
can	O
directly	O
reflect	O
the	O
amount	O
of	O
load	O
on	O
a	O
CPU	B-General_Concept
.	O
</s>
<s>
On	O
Linux	B-Application
systems	O
,	O
the	O
load-average	O
is	O
not	O
calculated	O
on	O
each	O
clock	O
tick	O
,	O
but	O
driven	O
by	O
a	O
variable	O
value	O
that	O
is	O
based	O
on	O
the	O
HZ	O
frequency	O
setting	O
and	O
tested	O
on	O
each	O
clock	O
tick	O
.	O
</s>
<s>
This	O
setting	O
defines	O
the	O
kernel	B-Operating_System
clock	O
tick	O
rate	O
in	O
Hertz	O
(	O
times	O
per	O
second	O
)	O
,	O
and	O
it	O
defaults	O
to	O
100	O
for	O
10ms	O
ticks	O
.	O
</s>
<s>
Kernel	B-Operating_System
activities	O
use	O
this	O
number	O
of	O
ticks	O
to	O
time	O
themselves	O
.	O
</s>
<s>
Specifically	O
,	O
the	O
timer.c::calc_load( )	O
function	O
,	O
which	O
calculates	O
the	O
load	B-Operating_System
average	I-Operating_System
,	O
runs	O
every	O
ticks	O
,	O
or	O
about	O
every	O
five	O
seconds	O
:	O
</s>
<s>
The	O
"	O
sampled	O
"	O
calculation	O
of	O
load	B-Operating_System
averages	I-Operating_System
is	O
a	O
somewhat	O
common	O
behavior	O
;	O
FreeBSD	O
,	O
too	O
,	O
only	O
refreshes	O
the	O
value	O
every	O
five	O
seconds	O
.	O
</s>
<s>
A	O
post	O
on	O
the	O
Linux	B-Application
mailing	O
list	O
considers	O
its	O
tick	O
insufficient	O
to	O
avoid	O
Moire	O
artifacts	O
from	O
such	O
collection	O
,	O
and	O
suggests	O
an	O
interval	O
of	O
4.61	O
seconds	O
instead	O
.	O
</s>
<s>
This	O
change	O
is	O
common	O
among	O
Android	B-Application
system	I-Application
kernels	B-Operating_System
,	O
although	O
the	O
exact	O
expression	O
used	O
assumes	O
an	O
HZ	O
of	O
100	O
.	O
</s>
<s>
vmstat	B-Device
vmstat	B-Device
reports	O
information	O
about	O
runnable	O
or	O
blocked	O
processes	O
,	O
memory	O
,	O
paging	O
,	O
block	O
I/O	B-General_Concept
,	O
traps	O
,	O
and	O
CPU	B-General_Concept
.	O
</s>
<s>
dool	O
(	O
formerly	O
dstat	O
)	O
,	O
atop	O
helps	O
correlate	O
all	O
existing	O
resource	O
data	O
for	O
processes	O
,	O
memory	O
,	O
paging	O
,	O
block	O
I/O	B-General_Concept
,	O
traps	O
,	O
and	O
CPU	B-General_Concept
activity	O
.	O
</s>
