Linux Labs

Inside the system: resources, kernel, processes / Stage 1 of 12

Load average and CPU load

Not running Starting usually ~20 s
Leave the lesson

Step 1 of 7 · on a machine · 4 min

An alarm with no load

What you will learn

  • Read the three load average numbers in uptime and compare them with the number of CPUs from nproc.
  • Tell processes waiting for the CPU from processes in the D state with ps, top and vmstat.
  • Change a process's priority with nice and renice.

This morning monitoring sent an alarm: the server's load average is above three. The machine has a single CPU, yet commands in the terminal answer at once. Look at the load yourself.

Exercise · look

Look at the load

Look at the load average in the uptime output, the number of CPUs on the machine and the %Cpu(s) line in top.

First, predict

The load average is above three, and the machine has one CPU. What will top show in the id field of the %Cpu(s) line — the share of time the CPU is idle?

Now start the exercise, run the command and compare your prediction with the output.

Sign in and start The machine is available after signing in
Check yourself 1 question

The load average is above three on a single CPU, while top shows the CPU almost free. Is the CPU overloaded?

  • An overloaded CPU is never idle: top would show an id near zero, and commands would answer with a delay.

  • Run top -bn1 | head -3 a few times: id is about 90% or more every time.

The CPU is free while the load average is high: the load average counts more than work on the CPU.

Ubuntu 24.04
Loading…