Load (computing): Difference between revisions

Content deleted Content added
Other system performance commands: make existing links to articles visible!!
Unix-style load calculation: mention also "/proc/stat" that is more level in addition to /proc/loadavg that is easily readable
Line 10:
14:34:03 up 10:43, 4 users, load average: 0.06, 0.11, 0.09
</syntaxhighlight>
The [[W (Unix)|<code>w</code>]] and [[Top (Unix)|<code>top</code>]] commands show the same three load average numbers, as do a range of [[graphical user interface]] utilities.

In operating systems based on the [[Linux (kernel)|Linux kernel]], theythese information can also be easily accessed by reading the [[procfs|<code>/proc/loadavg</code>]] file.
 
To explore this kind information in dept, according to the Linux's [[Filesystem Hierarchy Standard]], architecture-dependent information are exposed on the file <code>/proc/stat</code>.<ref>{{Cite web
|url = https://www.kernel.org/doc/html/latest/admin-guide/cpu-load.html
|title = CPU load
|access-date=2023-10-04
}}</ref><ref>{{Cite web
|url = https://tldp.org/LDP/Linux-Filesystem-Hierarchy/html/proc.html
|title = /proc
|access-date=2023-10-04
|website = Linux Filesystem Hierarchy
}}</ref><ref>{{Cite web
|url = https://www.kernel.org/doc/html/latest/filesystems/proc.html#miscellaneous-kernel-statistics-in-proc-stat
|title = Miscellaneous kernel statistics in /proc/stat
|access-date=2023-10-04
}}</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=http://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).