Methods of payment Abuse

What is LA (load average) and how is it calculated

18.07.2022, 01:24

During server monitoring, it is extremely important to correctly assess the system load. By understanding the load level, you can soberly assess the performance and operability of the system. For this purpose, experts, as a rule, evaluate the indicator of the average load Load Average. What it displays and how to measure it correctly - further in our article.

What is Load Average

Load Average (LA, average load) is an average measure of the load, displayed in the number of processes that are in a state of execution or in a state of waiting for resources for a time interval of 1, 5 and 15 minutes. For a better assessment of system performance, it is best to look at the average load, because due to short-term processes, the load fluctuates rapidly.

There are several simple ways to measure the average load. The easiest way is to register and execute the command. For example, in Linux, it is enough to execute the uptime command in the terminal. On the output, it will display the current time, the duration of the system operation, the number of users, and most importantly, the average load value in the interval of 1, 5 and 15 minutes. The load on the server is detected by executing the w command via the SSH console.

The result looks like this:

The average load value is calculated based on the processes that are running and are in the queue for execution (CPU, RAM, I/O). For the most part, LA is affected by CPU utilization, which is actually the only and key factor in increasing the load on the server.

Here is a simple example: there is a VPS with two cores. The average load value in the image above: 1.03, 1.11, 1.20 is the normal load value for a VPS with 2 cores.

1 (unit) LA = 100% load on 1 CPU core. If there are two cores on the VPS, then the average load can reach 2 LA:

- LA displays values 3.21, 4.22, 5.23 - the load is falling, but over the last 15 minutes it has been 4.22 on average, which is 422% of the load = 4 out of 2 cores - not the norm;

- LA shows values of 7.15, 5.24, 1.18 - the load is increasing, and over the last 15 minutes it was 1.18, within the normal range, which corresponds to 118% of the load = 1 of 2 cores - within the normal range (peak load, lasting up to 30 minutes, for example).

With three values at your disposal, you will be able to analyze the state of the system and evaluate its performance. If all three values are 0, then the system is in standby mode. If the values increase, it means that the load is growing, decreasing - the load is falling.

At the same time, it should be borne in mind that a large number of jumps can be observed in the system if a large number of users are connected at the same time. This means that in combination with commands, it is worth using various monitoring tools - Zabbix, Nagios, Monit. They record CPU and memory activity in the long run.

The consequences of a high Load Average for the server

It is extremely important for hosting to track the value of LA. The actions of the hoster in case of an increase in the load will depend on the cause of its occurrence. For example, if the load grows, exceeds the number of cores and lasts a long period of time, LA increases the queue of requests for execution. In the presence of KVM/OpenVZ virtualization, the resulting load has a bad effect on the physical server.

When a user performs a backup or unloading of goods in 1C, as a result of which there are spikes in load, there is no serious cause for concern for the hoster. But if the LA on a physical server significantly exceeds the norm and this phenomenon persists for a long time, certain measures are often required, since a high LA indicator has a negative effect for clients who have placed their projects on a specific physical server.