from Wikipedia, the free encyclopedia

Load (dt. "Load") refers to the currently running or waiting for certain events processes on a computer system. It is said that “the computer has a load of X” (where X is a positive number). It is commonly equated with the utilization of a computer system . In the Unix world, from which the term comes, one usually speaks of Load Average , the average of the load values ​​over a period of time.

Load as a unit of measure

The load is the number of processes currently running or waiting for events and is therefore always an integer (in contrast to the load average on Unix systems ). Such events are very often the termination of a write or read operation from or to the hard disk or other input / output devices. The load is therefore a measure of any bottleneck problems that occur .

For example, a large number of programs run in the background on an average computer system that normally generate almost no load. If the machine's memory becomes full by interactions of the user, the operating system supports the processes from memory to hard disk ( swapping ). However, every now and then it has to reload individual processes into memory so that it can execute them. Since the hard disk is a very slow data carrier in relation to the main memory, this can build up to a considerable load in the event of an acute main memory shortage, which can lead to the entire computer system being unusable, even though the processor is barely utilized.

The load is not the workload of the computer system, in particular not the workload of the CPU, but a measure of how many similar systems would have to work in a computer in order to be able to remove a possible bottleneck.

For example, a computer system has a processor. At the same time, two processes require full computing power (other resources are not considered in the example). The operating system now distributes the two processes evenly so that process 1 and process 2 receive the same amount of computing power ( scheduling ). The system load is 2, the CPU utilization is 100%. The computer system is expanded to four CPUs . The operating system now distributes this load between the two processes, so that two CPUs can always work fully, the other two are idle. Nevertheless, the processes now calculate twice as fast and the computer still has a load of 2, but the CPU's utilization is only 50%. Thanks to a program improvement, it is now possible to distribute the load of the two processes over all four CPUs. The load is still 2, but the CPUs are used to 100%, that is, the two programs calculate twice as fast.

The load average on Unix systems

The Load Average (loosely translated load average ) is by definition the (average) length of the run queue of the CPU and the number of processes running on this or input or output wait (status D ). The composition varies depending on the system, as do the usual values. In general, however, the following applies: The lower the load value, the less loaded a system is, i.e. more resources are available. The lower limit is 0. A load average of 0 indicates that all resources are available and that the system can process a user's tasks at maximum speed.

There is no upper limit for the load value. However, the system becomes increasingly difficult to use (depending on the number of CPUs and other resources, e.g. RAM , input and output ) with increasing system load, because all resources are permanently in use. If you want to work in an X session during this time, for example , the extreme system load becomes noticeable in that the interface reacts very slowly or not at all.

Typical specification and evaluation of the load average

Graphic representation of a load average number triplet

Usually, three numerical values ​​are specified for specifying the load average, each of which specifies the load average of the last minute, the last five minutes and the last 15 minutes (in this order). From this you can see how the utilization of the system is developing. The three values ​​are often called the load triplet .

In the graphic representation of the sample 0.80, 1.71, 3.35values, it is noticeable that the load decreases (see graphic on the right). This will be the case when there are less computationally intensive processes - this could be due to programs that were previously terminated and that had generated a significant load in the last 15 minutes.

Graphical representation of a load average, the load is increasing

The values 6.51, 5.13, 1.85are shown graphically in the graphic on the left . You can see that the load on the computer has increased significantly in the last 15 minutes, with the increase having decreased in the last five minutes.

Graphical representation of a load average with a power peak

In the example on the right you can use the three values ​​to determine that a considerable computing load has been processed within the last quarter of an hour, because at the current time the average load is significantly lower than it was five minutes ago.

From the load average values, an administrator can easily determine how busy the computer was. In contrast to resource-guzzling graphical system monitors , a Unix administrator only needs to query the load of his computer every quarter of an hour and thus receives comprehensive statistics on the utilization value. The load is calculated automatically by the kernel , so there is no need to record measured values ​​separately in real time .

Using the system load , for example, certain programs can only be started when the computer is idle , i.e. the load average is very low. An example of this is the Unix atdaemon . It offers the batchutility that can be instructed to start a program as soon as the load 1.5falls below the value of .

Programs for displaying the load average

A GUI program to display the load average over time is xload . It is usually standard on X Window Systems . The screenshot shows an increasing load, the horizontal line on half stands for the value 1 . Typical for graphical representations of the load average is the exponential drop in the graph after a load peak.

On POSIX compatible systems, the load average can usually uptimebe determined with the tool . A call from the shell gives the following result, for example:

 $ uptime
 00:58:04 up  7:07,  4 users,  load average: 0.55, 0.60, 0.48

In addition to the uptime corresponding to the name, i.e. the runtime since booting, uptime also outputs the current time, the number of users logged on and finally the load average triple.

Other tools for viewing on the console include w and top . There are also graphic tools, for example the classic xload (see right).

The unix-like system Linux offers an entry in the proc file system/proc/loadavg , which among other things shows the load average:

$ cat /proc/loadavg
0.27 0.47 0.45 1/186 8372

Percentage utilization values

Using the load average is very practical and efficient, but there is no way of finding out the current utilization of the processor . Current utilization values ​​are used, for example, in percentages in the widely used Microsoft Windows operating system in order to display the utilization of the system. Windows does not know a load average .

Percentage utilization values ​​for Linux

In order to get a percentage utilization value in Linux , the file has to be /proc/statread from the Proc file system. In the cpu lines it contains values ​​for User , Nice , System and Idle times since the system was started. These mean:

The CPU resources consumed by user processes.
Time for user processes that are running with a very high Nice value. This is the common Unix technique for giving processes a lower priority. Processes with very low priority are only executed when the computer is otherwise idle ( priority scheduling ).
Resources that the system, i.e. H. the Linux kernel is used up.
Represents the idle part of the processor in which no commands are processed by it. During such a phase, it is in the idle state.

The CPU utilization corresponds to the inverted percentage that Idle takes in the total calculation. An example of the file /proc/stat:

cpu  35421 0 4092 158570 3325 408 6 0
cpu0 35421 0 4092 158570 3325 408 6 0

The first four numbers that stand for User , Nice , System and Idle are relevant . In total, they give 198.083 in the example, of which the idle value is 158.570, which corresponds to about 80% of the total value. The effective CPU utilization since system start is therefore just 20%. In order to obtain a percentage CPU utilization over a certain period, the change in these values ​​over this period must be determined by reading out the file twice.

Web links


  1. man page w (1) - one page . Retrieved May 19, 2020.