Clever Geek Handbook
📜 ⬆️ ⬇️

Load average

The result of the htop utility, which shows a large system load

Average load ( Eng. Load average ) - the average value of the system load for a certain period of time, as a rule, is displayed in the form of three values, which are average values ​​for the last 1, 5 and 15 minutes, the lower the better [1] . On UNIX, this is the average of the computational work that the system performs.

Content

Unix Average Load Calculation

Typically, on UNIX-like systems , the average load is calculated inside the kernel . Users can easily get the current metric from the shell by running the uptime command :

  $ uptime
  14:34:03 up 10:43, 4 users, load average: 0.06, 0.11, 0.09

The w and top commands show the same 3 average load values. On Linux, they can also be obtained by reading the /proc/loadavg .

On idle computers, the average number of downloads is 0. Each process that uses or waits for the CPU ( wait queue ) increases the number of downloads by one. Most UNIX systems consider processes only in the running state (on the CPU) or ready to run (waiting on the CPU). However, Linux also includes counting processes in a state of deep sleep (still awaiting a hard drive ), which can lead to noticeably different results, especially when many processes block I / O.

For example, we can cite processes that are blocked as a result of errors of the NFS server or a slow storage system ( USB 1.x devices). Such situations lead to an increase in the average load indicator, however, they do not reflect the actual load on the CPU (but it gives an idea of ​​how long the user can wait for operations to be completed).

The average load is not a very accurate characteristic (if only because it determines the average values). And if there are several processors on the computer, then this characteristic cannot be trusted. With two processors, you can (theoretically) simultaneously run twice as many programs. This means that the average load of 2.00 (on a dual-processor computer) will be equivalent to the average load of 1.00 (on a single-processor computer). In fact this is not true. Due to the additional load caused by planning and some other factors, a dual-processor computer does not provide a doubling of speed compared to a single-processor version.

/ proc / loadavg

the text file provided to the user by the virtual file system / proc / contains 5 text fields separated by a space.

The first three fields contain the values ​​described above, i.e. system load values

The fourth field consists of two numbers separated by a slash: the number before the slash indicates the number of processes currently running; the number after the slash indicates the total number of processes in the system at the moment.

The fifth field shows the last PID ( process identifier ) allocated by the system.

  $ cat / proc / loadavg
    0.01 0.04 0.01 1/185 12122

Notes

  1. ↑ CPU Load: when to start worrying? (unopened) (March 24, 2014).

Links

  • Neil J. Gunther. UNIX Load Average - Part 1: How It Works . - TeamQuest.
  • Andre Lewis. Understanding Linux CPU Load - when should you be worried? // blog.scoutapp.com. - 2009.
  • Ray Walker. Examining Load Average // Linux Journal.
  • What exactly is a load average? // linuxtechsupport
  • http://www.eecs.berkeley.edu/Pubs/TechRpts/1987/CSD-87-353.pdf

see also

  • top
  • htop
  • atop
Source - https://ru.wikipedia.org/w/index.php?title=Load_Average&oldid=101088051


More articles:

  • Arctic
  • Sun City
  • Ace Attorney
  • Shenkursky Holy Trinity Monastery
  • Award Coin
  • Komsomolsky (Skopin)
  • Russian State Library for Youth
  • Memel operation (1944)
  • Danilovsky, Fedor Semenovich
  • Baltimore Orioles for the 2013 season

All articles

Clever Geek | 2019