Load (computing): Difference between revisions

Content deleted Content added
CPU load vs CPU utilization: Encyclopedic tone & accurate; prosody and nuance.
m Bot: http → https
Line 29:
}}</ref>
 
An idle computer has a load number of 0 (the idle process is not counted). Each [[process (computing)|process]] using or waiting for [[Central processing unit|CPU]] (the ''ready queue'' or [[run queue]]) increments the load number by 1. Each process that terminates decrements it by 1. Most UNIX systems count only processes in the ''running'' (on CPU) or ''runnable'' (waiting for CPU) [[Process state|states]]. However, Linux also includes processes in uninterruptible sleep states (usually waiting for [[Hard disk drive|disk]] activity), which can lead to markedly different results if many processes remain blocked in [[Input/output|I/O]] due to a busy or stalled I/O system.<ref>{{Cite web|url=httphttps://linuxtechsupport.blogspot.com/2008/10/what-exactly-is-load-average.html|title=Linux Tech Support: What exactly is a load average?|date=23 October 2008}}</ref> This, for example, includes processes blocking due to an [[Network File System|NFS]] server failure or too slow [[Data storage|media]] (e.g., [[USB]] 1.x storage devices). Such circumstances can result in an elevated load average, which does not reflect an actual increase in CPU use (but still gives an idea of how long users have to wait).
 
Systems calculate the load ''average'' as the [[Moving average#Exponential moving average|exponentially damped/weighted moving average]] of the load ''number''. The three values of load average refer to the past one, five, and fifteen minutes of system operation.<ref name="drdobbs">{{cite web |url=httphttps://www.linuxjournal.com/article/9001 |title=Examining Load Average |first=Ray |last=Walker |date=1 December 2006 |work=Linux Journal |access-date=13 March 2012 }}</ref>
 
Mathematically speaking, all three values always average all the system load since the system started up. They all decay exponentially, but they decay at different ''speeds'': they decay exponentially by ''e'' after 1, 5, and 15 minutes respectively. Hence, the 1-minute load average consists of 63% (more precisely: 1 - 1/''e'') of the load from the last minute and 37% (1/''e'') of the average load since start up, excluding the last minute. For the 5- and 15-minute load averages, the same 63%/37% ratio is computed over 5 minutes and 15 minutes, respectively. Therefore, it is not technically accurate that the 1-minute load average only includes the last 60 seconds of activity, as it includes 37% of the activity from the past, but it is correct to state that it includes ''mostly'' the last minute.
Line 93:
The "sampled" calculation of load averages is a somewhat common behavior; FreeBSD, too, only refreshes the value every five seconds. The interval is usually taken to not be exact so that they do not collect processes that are scheduled to fire at a certain moment.<ref>{{cite web |title=How is load average calculated on FreeBSD? |url=https://unix.stackexchange.com/a/342778 |website=Unix & Linux Stack Exchange}}</ref>
 
A post on the Linux mailing list considers its {{tt|+1}} tick insufficient to avoid Moire artifacts from such collection, and suggests an interval of 4.61 seconds instead.<ref>{{cite web |last1=Ripke |first1=Klaus |title=Linux-Kernel Archive: LOAD_FREQ (4*HZ+61) avoids loadavg Moire |url=httphttps://lkml.iu.edu/hypermail/linux/kernel/1111.1/02446.html |website=lkml.iu.edu |date=2011}} [http://ripke.com/loadavg/moire graph & patch]</ref> This change is common among [[Android system]] kernels, although the exact expression used assumes an HZ of 100.<ref>{{cite web |title=Patch kernel with the 4.61s load thing · Issue #2109 · AOSC-Dev/aosc-os-abbs |url=https://github.com/AOSC-Dev/aosc-os-abbs/issues/2109 |website=GitHub |language=en}}</ref>
 
==Other system performance commands==
Line 104:
* <code>[[Iftop|iftop]]</code>{{Snd}} interactive network traffic viewer per interface
* <code>nethogs</code>{{Snd}} interactive network traffic viewer per process
* <code>iotop</code>{{Snd}} interactive I/O viewer<ref>{{Cite web|url=httphttps://man7.org/linux/man-pages/man8/iotop.8.html|title = Iotop(8) - Linux manual page}}</ref>
* <code>[[Iostat (Unix)|iostat]]</code>{{Snd}} for storage I/O statistics
* <code>[[Netstat (Unix)|netstat]]</code>{{Snd}} for network statistics
Line 122:
|author = Brendan Gregg
|title = Linux Load Averages: Solving the Mystery
|url = httphttps://www.brendangregg.com/blog/2017-08-08/linux-load-averages.html
|date = 8 August 2017
|access-date = 2018-01-22
Line 135:
* {{cite web
|title = Understanding Linux CPU Load{{Snd}} when should you be worried?
|url = httphttps://blog.scoutapp.com/articles/2009/07/31/understanding-load-averages
|author = Andre Lewis
|date = 31 July 2009
Line 143:
|author = Ray Walker
|title = Examining Load Average
|url = httphttps://www.linuxjournal.com/article/9001
|publisher = Linux Journal
|date = 1 December 2006