facebook youtube pinterest twitter reddit whatsapp instagram

Understanding Load Average In GNU/Linux

Load average is the average number of processes that is calculated over a period of time, they can either be in a runnable or uninterrupted‐able state. When a process is in a runnable state, it is either using the CPU or waiting to use the CPU, and when a process is in an uninterrupted‐able state, it is waiting for some I/O access, e.g waiting for the disk.

There are a couple of ways you can check the load average, you can either use htop, top, uptime, and even directly from the test file that stores it in the first place (/proc/loadav), I prefer the uptime command, as it gives me one-line information, which is easy on the eye.

To check a load average you simply execute the following command:

uptime

Output

19:40:04 up 89 days,  9:57,  3 users,  load average: 0.07, 0.04, 0.06

The above shows the averages of the load, which are taken over a three-time interval, each representing 1 minute, 5 minutes, and 15 minutes.

In the above output, I have the following load averages: 0.07, 0.04, 0.06, and the output means:

  • load average over the last 1 minute is 0.07
  • load average over the last 5 minutes is 0.04
  • load average over the last 15 minutes is 0.06

This is a bit tricky to understand if you don't know the number of core/CPU on your system, so, if you have a single CPU system, a load average of 1 means it is loaded all the time, this means your system is over hogged & is in full capacity. If you have 4 CPU, a load average of 1 won't overload the system, first, check the number of processing units on your system using the following command:

nproc

This would print the number of processing units available.

To understand it better, let's take a few assumptions with a load average of 0.00, 0.00, 0.00

On a single-core system this would mean:

  • Your CPU was fully idle over the last 1 minute, the last 5 minutes, and over the last 15 minutes, this isn't normal on a working server, so, you might want to investigate why your CPU isn't working, perhaps, some processes aren't starting.

Load average of 0.5, 0.7, 1.35 On a single-core system this would mean (a single-core CPU can only handle one process at a time):

  • The CPU has been idle for 50% on average over the last 1 minute
  • The CPU has been idle for 70% on average over the last 5 minute
  • The CPU was busy all the time, while there was on average one other process waiting for 35% over the last 15 minutes

This is a bit different on a multi-core CPU, I'll explain that in a future guide.