Load (computing): Difference between revisions

Content deleted Content added
Undid revision 510159511 by 200.201.3.32 (talk) HZ, not Hz, is the correct variable (edit over 7 years old!)
m Typo fixing (general fixes), replaced: pp. 515-528 → pp. 515–528, ’ → ', - → {{Snd}} (3), deprecated tag tt → code, remove inappropriate ELs for dstat and iotop
Line 4:
 
== Unix-style load calculation ==
All Unix and Unix-like systems generate a dimensionless [[Software metric|metric]] of three "load average" numbers in the [[kernel (computer science)|kernel]]. Users can easily query the current result from a [[Unix shell]] by running the <ttcode>[[uptime]]</ttcode> command:
<source lang="console">
$ uptime
14:34:03 up 10:43, 4 users, load average: 0.06, 0.11, 0.09
</source>
The [[W (Unix)|<ttcode>w</ttcode>]] and [[Top (Unix)|<ttcode>top</ttcode>]] commands show the same three load average numbers, as do a range of [[graphical user interface]] utilities. In [[Linux]], they can also be accessed by reading the [[procfs|<code>/proc/loadavg</code>]] file.
 
An idle computer has a load number of 0 (the idle process isn't 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 states|states]]. However, Linux also includes processes in [[uninterruptible sleep]] states (usually waiting for [[Hard disk|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>http://linuxtechsupport.blogspot.com/2008/10/what-exactly-is-load-average.html</ref> This, for example, includes processes blocking due to an [[Network File System (protocol)|NFS]] server failure or too slow [[Data storage device|media]] (e.g., [[Universal Serial Bus|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).
Line 32:
 
== CPU load vs CPU utilization ==
The comparative study of different load indices carried out by Ferrari et al.<ref name="Empirical load">Ferrari, Domenico; and Zhou, Songnian; "[http://www.eecs.berkeley.edu/Pubs/TechRpts/1987/CSD-87-353.pdf An Empirical Investigation of Load Indices For Load Balancing Applications]", Proceedings of Performance ’87'87, the 12th International Symposium on Computer Performance Modeling, Measurement, and Evaluation, North Holland Publishers, Amsterdam, The Netherlands, 1988, pp. 515-528515–528</ref> reported that CPU load information based upon the CPU queue length does much better in load balancing compared to CPU utilization. The reason CPU queue length did better is probably because when a host is heavily loaded, its CPU utilization is likely to be close to 100% and it is unable to reflect the exact load level of the utilization. In contrast, CPU queue lengths can directly reflect the amount of load on a CPU. As an example, two systems, one with 3 and the other with 6 processes in the queue, are both very likely to have utilizations close to 100% although they obviously differ.{{ororiginal research inline|date=May 2013}}
 
== Reckoning CPU load ==
Line 55:
}
</source>
The countdown is over a {{code|LOAD_FREQ}} of 5 &nbsp;HZ.<ref group="note">
<poem>
1 HZ = 100 ticks
Line 82:
==Other system performance commands==
Other commands for assessing system performance include:
* <ttcode>[[uptime]]</ttcode>{{Snd}} the system reliability and load average
 
* [[Top (Unix)|<ttcode>top</ttcode>]]{{Snd}} for an overall system view
* <tt>[[uptime]]</tt> the system reliability and load average
* [[Vmstat (Unix)|<ttcode>vmstat</ttcode>]]{{Snd}} vmstat reports information about runnable or blocked processes, memory, paging, block I/O, traps, and CPU.
* [[Top (Unix)|<tt>top</tt>]] for an overall system view
* [[Htop (Unix)|<ttcode>htop</ttcode>]]{{Snd}} interactive process viewer
* [[Vmstat (Unix)|<tt>vmstat</tt>]] vmstat reports information about runnable or blocked processes, memory, paging, block I/O, traps, and CPU.
* <ttcode>dstat</ttcode> [http://dag.wiee.rs/home-made/dstat/]{{Snd}} helps correlate all existing resource data for processes, memory, paging, block I/O, traps, and CPU activity.
* [[Htop (Unix)|<tt>htop</tt>]] interactive process viewer
* [[iftop|<code>iftop</code>]]{{Snd}} interactive network traffic viewer per interface
* <tt>dstat</tt> [http://dag.wiee.rs/home-made/dstat/] helps correlate all existing resource data for processes, memory, paging, block I/O, traps, and CPU activity.
* [[iftop|<ttcode>iftopnethogs</ttcode>]]{{Snd}} interactive network traffic viewer per interfaceprocess
* <ttcode>nethogsiotop</ttcode>{{Snd}} interactive network trafficI/O viewer per process<ref>http://man7.org/linux/man-pages/man8/iotop.8.html</ref>
* [[Iostat (Unix)|<code>iostat</code>]]{{Snd}} for storage I/O statistics
* <tt>iotop</tt><ref>http://man7.org/linux/man-pages/man8/iotop.8.html</ref> interactive I/O viewer - [http://guichaz.free.fr/iotop/ iotop homepage]
* [[IostatNetstat (Unix)|<ttcode>iostatnetstat</ttcode>]]{{Snd}} for storage I/Onetwork statistics
* <code>[[Netstat (Unix)|<tt>netstatmpstat]]</ttcode>]]{{Snd}} for networkCPU statistics
* <ttcode>[[xload]]tload</ttcode>{{Snd}} load average graph for Xterminal
* <tt>[[mpstat]]</tt> for CPU statistics
* <ttcode>tload[[xload]]</ttcode>{{Snd}} load average graph for terminalX
* <ttcode>/proc/loadavg</ttcode>{{Snd}} text file containing load average
* <tt>[[xload]]</tt> load average graph for X
* <tt>/proc/loadavg</tt> text file containing load average
 
== See also ==
Line 110 ⟶ 109:
}}
* {{cite web
|title = UNIX Load Average{{Snd}} Part 1: How It Works
|url = http://www.teamquest.com/pdfs/whitepaper/ldavg1.pdf
|author = [[Neil J. Gunther]]
Line 119 ⟶ 118:
}}<ref group="note">This paper's discussion is useful, but it contains at least one error, in equation 3 (Section 4.2, page 12): The equation should be <math>load(t) = n e^{-\frac 5{60}} + load(t-1) (1 - e^{-\frac 5{60}})</math> instead of <math>load(t) = load(t-1) e^{-\frac 5{60}} + n (1 - e^{-\frac 5{60}}).</math></ref>
* {{cite web
|title = Understanding Linux CPU Load -{{Snd}} when should you be worried?
|url = http://blog.scoutapp.com/articles/2009/07/31/understanding-load-averages
|author = Andre Lewis