<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>http://vwiki.co.uk/index.php?action=history&amp;feed=atom&amp;title=High_System_Load_%28Ubuntu%29</id>
	<title>High System Load (Ubuntu) - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://vwiki.co.uk/index.php?action=history&amp;feed=atom&amp;title=High_System_Load_%28Ubuntu%29"/>
	<link rel="alternate" type="text/html" href="http://vwiki.co.uk/index.php?title=High_System_Load_(Ubuntu)&amp;action=history"/>
	<updated>2026-05-09T15:09:56Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.6</generator>
	<entry>
		<id>http://vwiki.co.uk/index.php?title=High_System_Load_(Ubuntu)&amp;diff=2174&amp;oldid=prev</id>
		<title>Sstrutt: Initial creation - content from Ubuntu Troubleshooting page</title>
		<link rel="alternate" type="text/html" href="http://vwiki.co.uk/index.php?title=High_System_Load_(Ubuntu)&amp;diff=2174&amp;oldid=prev"/>
		<updated>2012-10-11T20:59:12Z</updated>

		<summary type="html">&lt;p&gt;Initial creation - content from Ubuntu Troubleshooting page&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;The system load of a Linux system is normally represented by the load average over intervals of the last 1, 5 and 15 minutes.&lt;br /&gt;
&lt;br /&gt;
For example, the &amp;lt;code&amp;gt;uptime&amp;lt;/code&amp;gt; command gives a single line summary of system uptime and recent load&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
user@server:~$ uptime&lt;br /&gt;
 14:28:49 up 9 days, 22:41,  1 user,  load average: 0.34, 0.36, 0.32&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So in the above, as of 14:28:49 hrs the server has been up for 9 days 22 hours odd, has 1 user logged in, and the system load averages for the past 1, 5, and 15 minutes are shown.&lt;br /&gt;
&lt;br /&gt;
The load average for a given period indicates how many processes were running or in a uninterruptable (waiting for IO) state.  What&amp;#039;s bad depends on your system, for a single CPU system a load average greater than 1 could be considered bad as there are more processes running than CPU&amp;#039;s to service them.  Though if you expect peaks in load, then a high load over the last minute might not concern, whereas over 15mins it would.&lt;br /&gt;
&lt;br /&gt;
The problem with investigating performance issues is that you need to know what is normal, so you can determine what&amp;#039;s wrong once application/service performance deteriorates.  But its unlikely that you would have pain much attention to underlying system metrics until things are already bad.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;code&amp;gt;top&amp;lt;/code&amp;gt; ==&lt;br /&gt;
The &amp;lt;code&amp;gt;top&amp;lt;/code&amp;gt; command allows some basic insight into the system&amp;#039;s performance, and is akin to the Task Manager in Windows.  It probably won&amp;#039;t provide the answer as to what the problem is, but it will probably allow you to focus in on the process(es) that are causing grief.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
user@server:~$ top&lt;br /&gt;
top - 14:32:09 up 9 days, 22:44,  1 user,  load average: 0.70, 0.44, 0.34&lt;br /&gt;
Tasks: 137 total,   1 running, 136 sleeping,   0 stopped,   0 zombie&lt;br /&gt;
Cpu(s): 93.8%us,  6.2%sy,  0.0%ni,  0.0%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st&lt;br /&gt;
Mem:   1023360k total,   950520k used,    72840k free,    10836k buffers&lt;br /&gt;
Swap:  1757176k total,  1110228k used,   646948k free,   135524k cached&lt;br /&gt;
&lt;br /&gt;
  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND&lt;br /&gt;
 6608 zimbra    20   0  556m  69m  12m S 69.1  6.9   0:03.26 java&lt;br /&gt;
17284 zimbra    20   0  649m 101m 3604 S  4.6 10.1  31:34.74 java&lt;br /&gt;
 2610 zimbra    20   0  976m 181m 3700 S  0.7 18.1 133:06.68 java&lt;br /&gt;
    1 root      20   0 23580 1088  732 S  0.0  0.1   0:04.70 init&lt;br /&gt;
    2 root      20   0     0    0    0 S  0.0  0.0   0:00.01 kthreadd&lt;br /&gt;
    3 root      RT   0     0    0    0 S  0.0  0.0   0:00.00 migration/0&lt;br /&gt;
....&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that CPU metrics are with respect to 1 CPU, so on a multiple CPU system, seeing values &amp;gt; 100% is valid.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;vwikitable-equal&amp;quot; &lt;br /&gt;
|+ Overview of CPU Metrics, % of CPU time spent on&lt;br /&gt;
! Code  &lt;br /&gt;
! &amp;lt;code&amp;gt; us &amp;lt;/code&amp;gt;&lt;br /&gt;
! &amp;lt;code&amp;gt; sy &amp;lt;/code&amp;gt;&lt;br /&gt;
! &amp;lt;code&amp;gt; ni &amp;lt;/code&amp;gt;&lt;br /&gt;
! &amp;lt;code&amp;gt; id &amp;lt;/code&amp;gt;&lt;br /&gt;
! &amp;lt;code&amp;gt; wa &amp;lt;/code&amp;gt;&lt;br /&gt;
! &amp;lt;code&amp;gt; ha &amp;lt;/code&amp;gt;&lt;br /&gt;
! &amp;lt;code&amp;gt; si &amp;lt;/code&amp;gt;&lt;br /&gt;
! &amp;lt;code&amp;gt; st &amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! Name&lt;br /&gt;
| User CPU&lt;br /&gt;
| System CPU&lt;br /&gt;
| Nice CPU&lt;br /&gt;
| Idle CPU&lt;br /&gt;
| IO Wait&lt;br /&gt;
| Hardware Interrupts&lt;br /&gt;
| Software Interrupts&lt;br /&gt;
| Steal&lt;br /&gt;
|-&lt;br /&gt;
! Description&lt;br /&gt;
| user processes (excluding nice)&lt;br /&gt;
| kernel processes&lt;br /&gt;
| user nice processes (nice reduces the priority of process)&lt;br /&gt;
| idling (doing nothing)&lt;br /&gt;
| waiting for IO (high indicates disk/network bottleneck)&lt;br /&gt;
| hardware interrupts&lt;br /&gt;
| software interrupts&lt;br /&gt;
| servicing virtual machines&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;vwikitable&amp;quot;&lt;br /&gt;
|+ Task column heading descriptions (to change what columns are shown press &amp;lt;code&amp;gt;f&amp;lt;/code&amp;gt;)&lt;br /&gt;
! Key			!! Display  		!! Name		!! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;a&amp;lt;/code&amp;gt;	|| &amp;lt;code&amp;gt;PID&amp;lt;/code&amp;gt;	|| Process ID	|| Task/process identifier&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;b&amp;lt;/code&amp;gt;	|| &amp;lt;code&amp;gt;PPID&amp;lt;/code&amp;gt;	|| Parent PID	|| Task/process identifier of processes parent (ie the process that launched this process)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;c&amp;lt;/code&amp;gt;	|| &amp;lt;code&amp;gt;RUSER&amp;lt;/code&amp;gt;	|| Real User Name || Real username of task&amp;#039;s owner&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;d&amp;lt;/code&amp;gt;	|| &amp;lt;code&amp;gt;UID&amp;lt;/code&amp;gt;	|| User ID	|| User ID of task&amp;#039;s owner&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;e&amp;lt;/code&amp;gt;	|| &amp;lt;code&amp;gt;USER&amp;lt;/code&amp;gt;	|| User Name	|| Username ID of task&amp;#039;s owner&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;f&amp;lt;/code&amp;gt;	|| &amp;lt;code&amp;gt;GROUP&amp;lt;/code&amp;gt;	|| Group Name	|| Group name of task&amp;#039;s owner&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;g&amp;lt;/code&amp;gt;	|| &amp;lt;code&amp;gt;TTY&amp;lt;/code&amp;gt;	|| Controlling TTY	|| Device that started the process&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;h&amp;lt;/code&amp;gt;	|| &amp;lt;code&amp;gt;PR&amp;lt;/code&amp;gt;	|| Priority	|| The task&amp;#039;s priority&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;i&amp;lt;/code&amp;gt;	|| &amp;lt;code&amp;gt;NI&amp;lt;/code&amp;gt;	|| Nice value	|| Adjusted task priority. From -20 meaning high priority, through 0 meaning unadjusted, to 19 meaning low priority &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;j&amp;lt;/code&amp;gt;	|| &amp;lt;code&amp;gt;P&amp;lt;/code&amp;gt;	|| Last Used CPU	|| ID of the CPU last used by the task&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;k&amp;lt;/code&amp;gt;	|| &amp;lt;code&amp;gt;%CPU&amp;lt;/code&amp;gt;	|| CPU Usage	|| Task&amp;#039;s usage of CPU&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;l&amp;lt;/code&amp;gt;	|| &amp;lt;code&amp;gt;TIME&amp;lt;/code&amp;gt;	|| CPU Time	|| Total CPU time used by the task&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;m&amp;lt;/code&amp;gt;	|| &amp;lt;code&amp;gt;TIME+&amp;lt;/code&amp;gt;	|| CPU Time, hundredths	|| Total CPU time used by the task in sub-second accuracy&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt;	|| &amp;lt;code&amp;gt;%MEM&amp;lt;/code&amp;gt;	|| Memory usage (RES)	|| Task&amp;#039;s usage of available physical memory&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;o&amp;lt;/code&amp;gt;	|| &amp;lt;code&amp;gt;VIRT&amp;lt;/code&amp;gt;	|| Virtual Image (kb)	|| Task&amp;#039;s allocation of virtual memory&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt;	|| &amp;lt;code&amp;gt;SWAP&amp;lt;/code&amp;gt;	|| Swapped size (kb)	|| Task&amp;#039;s swapped memory (resident in swap-file)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;q&amp;lt;/code&amp;gt;	|| &amp;lt;code&amp;gt;RES&amp;lt;/code&amp;gt;	|| Resident size (kb)	|| Task&amp;#039;s unswapped memory (resident in physical memory)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;r&amp;lt;/code&amp;gt;	|| &amp;lt;code&amp;gt;CODE&amp;lt;/code&amp;gt;	|| Code size (kb)	|| Task&amp;#039;s virtual memory used for executable code&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;s&amp;lt;/code&amp;gt;	|| &amp;lt;code&amp;gt;DATA&amp;lt;/code&amp;gt;	|| Data+Stack size (kb)	|| Task&amp;#039;s virtual memory not used for executable code&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;t&amp;lt;/code&amp;gt;	|| &amp;lt;code&amp;gt;SHR&amp;lt;/code&amp;gt;	|| Shared Mem size (kb)	|| Task&amp;#039;s shared memory&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;u&amp;lt;/code&amp;gt;	|| &amp;lt;code&amp;gt;nFLT&amp;lt;/code&amp;gt;	|| Page Fault count || Major/Hard page faults that have occurred for the task  &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;v&amp;lt;/code&amp;gt;	|| &amp;lt;code&amp;gt;nDRT&amp;lt;/code&amp;gt;	|| Dirty Pages count || Tasks memory pages that have been modified since last write to disk, and so can be readily freed from physical memory &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;w&amp;lt;/code&amp;gt;	|| &amp;lt;code&amp;gt;S&amp;lt;/code&amp;gt;	|| Process Status || &lt;br /&gt;
* D - Uninterruptible sleep&lt;br /&gt;
* R - Running&lt;br /&gt;
* S - Sleeping&lt;br /&gt;
* T - Traced or Stopped&lt;br /&gt;
* Z - Zombie&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;x&amp;lt;/code&amp;gt;	|| &amp;lt;code&amp;gt;Command&amp;lt;/code&amp;gt;	|| Command Line || Command used to start task&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;y&amp;lt;/code&amp;gt;	|| &amp;lt;code&amp;gt;WCHAN&amp;lt;/code&amp;gt;	|| Sleeping in Function || Name (or address) of function that the task is sleeping in&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;z&amp;lt;/code&amp;gt;	|| &amp;lt;code&amp;gt;Flags&amp;lt;/code&amp;gt;	|| Taks Flags || Task&amp;#039;s scheduling flags&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Identify Process Causing Occasional High System Load ===&lt;br /&gt;
If the high load is constant, just fire up &amp;lt;code&amp;gt;top&amp;lt;/code&amp;gt; and see if there is a specific process to blame, or if your stuck waiting for disk or network IO.&lt;br /&gt;
&lt;br /&gt;
If the high load is transient but repetitive, then you&amp;#039;ll need to capture the output of &amp;lt;code&amp;gt;top&amp;lt;/code&amp;gt; at the right time, the following script will create a log of &amp;lt;code&amp;gt;top&amp;lt;/code&amp;gt; output during periods of high load&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;#!/bin/bash&lt;br /&gt;
#&lt;br /&gt;
# During high load, write output form top to file.&lt;br /&gt;
#&lt;br /&gt;
# Simon Strutt - July 2012&lt;br /&gt;
&lt;br /&gt;
LOGFILE=&amp;quot;/home/user/load_log.txt&amp;quot;  # Update to a valid folder path&lt;br /&gt;
MAXLOAD=100                        # Multiple by 100 as &amp;#039;if&amp;#039; comparison can only handle integers&lt;br /&gt;
&lt;br /&gt;
LOAD=`cut -d &amp;#039; &amp;#039; -f 1 /proc/loadavg`&lt;br /&gt;
LOAD=`echo $LOAD &amp;#039;*100&amp;#039; | bc -l | awk -F &amp;#039;.&amp;#039; &amp;#039;{ print $1; exit; }&amp;#039;`     # Convert load to x100 integer&lt;br /&gt;
&lt;br /&gt;
if [ $LOAD -gt $MAXLOAD ]; then&lt;br /&gt;
        echo `date &amp;#039;+%Y-%m-%d %H:%M:%S&amp;#039;`&amp;gt;&amp;gt; ${LOGFILE}&lt;br /&gt;
        top -b -n 1 &amp;gt;&amp;gt; ${LOGFILE}&lt;br /&gt;
fi&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Schedule with something like (update with correct path to &amp;lt;code&amp;gt;load_log&amp;lt;/code&amp;gt;...&lt;br /&gt;
&amp;lt;pre&amp;gt;crontab -e&lt;br /&gt;
1 * * * * /bin/bash  /home/user/load_log&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;code&amp;gt; vmstat &amp;lt;/code&amp;gt; ==&lt;br /&gt;
[http://www.linuxcommand.org/man_pages/vmstat8.html &amp;lt;code&amp;gt;vmstat&amp;lt;/code&amp;gt;] is principally used for reporting on virtual memory statistics, for example &amp;lt;code&amp;gt; vmstat 5 3 &amp;lt;/code&amp;gt; creates an output every 5 seconds for 3 iterations, &lt;br /&gt;
&amp;lt;pre&amp;gt;user@server:~$ vmstat 5 3&lt;br /&gt;
procs -----------memory---------- ---swap-- -----io---- -system-- ----cpu----&lt;br /&gt;
 r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa&lt;br /&gt;
 0  0  42676 479556  34192 106944    5    5    31  3678   84   89  9  9 75  7&lt;br /&gt;
 0  0  42676 479548  34208 106948    0    0     0    10   50  105  6  0 88  5&lt;br /&gt;
 0  0  42676 479548  34216 106948    0    0     0    18   37   61  0  0 96  4 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the first line of output contains average/total counts since system start, with subsequent output being for the period since the last line of output.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;vwikitable-equal&amp;quot; &lt;br /&gt;
|+ Overview of VMSTAT Metrics&lt;br /&gt;
! Section&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot;| Procs&lt;br /&gt;
! colspan=&amp;quot;4&amp;quot;| Memory&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot;| Swap&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot;| IO&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot;| System&lt;br /&gt;
! colspan=&amp;quot;4&amp;quot;| CPU&lt;br /&gt;
|-&lt;br /&gt;
! Code&lt;br /&gt;
! &amp;lt;code&amp;gt; r &amp;lt;/code&amp;gt;&lt;br /&gt;
! &amp;lt;code&amp;gt; b &amp;lt;/code&amp;gt;&lt;br /&gt;
! &amp;lt;code&amp;gt; swpd &amp;lt;/code&amp;gt;&lt;br /&gt;
! &amp;lt;code&amp;gt; free &amp;lt;/code&amp;gt;&lt;br /&gt;
! &amp;lt;code&amp;gt; buff &amp;lt;/code&amp;gt;&lt;br /&gt;
! &amp;lt;code&amp;gt; cache &amp;lt;/code&amp;gt;&lt;br /&gt;
! &amp;lt;code&amp;gt; si &amp;lt;/code&amp;gt;&lt;br /&gt;
! &amp;lt;code&amp;gt; so &amp;lt;/code&amp;gt;&lt;br /&gt;
! &amp;lt;code&amp;gt; bi &amp;lt;/code&amp;gt;&lt;br /&gt;
! &amp;lt;code&amp;gt; bo &amp;lt;/code&amp;gt;&lt;br /&gt;
! &amp;lt;code&amp;gt; in &amp;lt;/code&amp;gt;&lt;br /&gt;
! &amp;lt;code&amp;gt; cs &amp;lt;/code&amp;gt;&lt;br /&gt;
! &amp;lt;code&amp;gt; us &amp;lt;/code&amp;gt;&lt;br /&gt;
! &amp;lt;code&amp;gt; sy &amp;lt;/code&amp;gt;&lt;br /&gt;
! &amp;lt;code&amp;gt; id &amp;lt;/code&amp;gt;&lt;br /&gt;
! &amp;lt;code&amp;gt; wa &amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! Name&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Run&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Block&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Swap&amp;lt;br&amp;gt;(kB)&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Free&amp;lt;br&amp;gt;(kB)&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Buffer&amp;lt;br&amp;gt;(kB)&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Cache&amp;lt;br&amp;gt;(kB)&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Swap In&amp;lt;br&amp;gt;(kB/s)&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Swap Out&amp;lt;br&amp;gt;(kB/s)&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Blocks In&amp;lt;br&amp;gt;(blocks/s)&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Blocks Out&amp;lt;br&amp;gt;(blocks/s)&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Interrupts&amp;lt;br&amp;gt;(/s)&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Context Switch&amp;lt;br&amp;gt;(/s)&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | User&amp;lt;br&amp;gt;(% time)&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | System&amp;lt;br&amp;gt;(% time)&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Idle&amp;lt;br&amp;gt;(% time)&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Wait&amp;lt;br&amp;gt;(% time)&lt;br /&gt;
|-&lt;br /&gt;
! Description&lt;br /&gt;
| Processes waiting for run time&lt;br /&gt;
| Processes in uninterruptible sleep (eg waiting for IO)&lt;br /&gt;
| Virtual memory used&lt;br /&gt;
| Unused memory&lt;br /&gt;
| Memory used as buffers&lt;br /&gt;
| Memory used as cache&lt;br /&gt;
| Memory swapped in from disk&lt;br /&gt;
| Memory swapped out to disk&lt;br /&gt;
| Blocks in from a storage device&lt;br /&gt;
| Blocks out from a storage device&lt;br /&gt;
| Interrupts&lt;br /&gt;
| Context switches&lt;br /&gt;
| CPU running user processes&lt;br /&gt;
| CPU running kernel processes&lt;br /&gt;
| CPU idle&lt;br /&gt;
| CPU waiting for IO&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;code&amp;gt; mpstat &amp;lt;/code&amp;gt; ==&lt;br /&gt;
[http://www.linuxcommand.org/man_pages/mpstat1.html &amp;lt;code&amp;gt;mpstat&amp;lt;/code&amp;gt;] reports on basic processor stats.  It creates a timestamped output which is useful to leave running on a console (or logged to a file) for when you might here or find out about service performance problems after the fact. A number of the metrics are also provided by &amp;lt;code&amp;gt;[[#vmstat|vmstat]]&amp;lt;/code&amp;gt;, but are reported to a greater accuracy by &amp;lt;code&amp;gt;mpstat&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Its not available by default, and comes as part of the [http://sebastien.godard.pagesperso-orange.fr/ &amp;lt;code&amp;gt;sysstat&amp;lt;/code&amp;gt;] package (to install, use &amp;lt;code&amp;gt;apt-get install sysstat&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
For example &amp;lt;code&amp;gt; mpstat 5 3 &amp;lt;/code&amp;gt; creates an output every 5 seconds for 3 iterations,&lt;br /&gt;
&amp;lt;pre&amp;gt;user@server:~# mpstat 5 3&lt;br /&gt;
Linux 2.6.32-41-server (server)   25/07/12        _x86_64_        (1 CPU)&lt;br /&gt;
&lt;br /&gt;
11:50:59     CPU    %usr   %nice    %sys %iowait    %irq   %soft  %steal  %guest   %idle&lt;br /&gt;
11:51:04     all    1.00    0.00    0.80    1.60    0.00    0.00    0.00    0.00   96.60&lt;br /&gt;
11:51:09     all    4.60    0.00    0.40    2.60    0.00    0.00    0.00    0.00   92.40&lt;br /&gt;
11:51:14     all   43.20    0.00    6.00    3.00    0.00    0.00    0.00    0.00   47.80&lt;br /&gt;
Average:     all   16.27    0.00    2.40    2.40    0.00    0.00    0.00    0.00   78.93 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;vwikitable-equal&amp;quot; &lt;br /&gt;
|+ Overview of MPSTAT Metrics&lt;br /&gt;
! Code&lt;br /&gt;
! &amp;lt;code&amp;gt; CPU &amp;lt;/code&amp;gt;&lt;br /&gt;
! &amp;lt;code&amp;gt; %usr &amp;lt;/code&amp;gt;&lt;br /&gt;
! &amp;lt;code&amp;gt; %nice &amp;lt;/code&amp;gt;&lt;br /&gt;
! &amp;lt;code&amp;gt; %sys &amp;lt;/code&amp;gt;&lt;br /&gt;
! &amp;lt;code&amp;gt; %iowait &amp;lt;/code&amp;gt;&lt;br /&gt;
! &amp;lt;code&amp;gt; %irq &amp;lt;/code&amp;gt;&lt;br /&gt;
! &amp;lt;code&amp;gt; %soft &amp;lt;/code&amp;gt;&lt;br /&gt;
! &amp;lt;code&amp;gt; %steal &amp;lt;/code&amp;gt;&lt;br /&gt;
! &amp;lt;code&amp;gt; %guest &amp;lt;/code&amp;gt;&lt;br /&gt;
! &amp;lt;code&amp;gt; %idle &amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! Name&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | CPU No.&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | User&amp;lt;br&amp;gt;(% util)&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nice&amp;lt;br&amp;gt;(% util)&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | System&amp;lt;br&amp;gt;(% util)&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | IO Wait&amp;lt;br&amp;gt;(% time)&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Hard IRQ&amp;lt;br&amp;gt;(% time)&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Soft IRQ&amp;lt;br&amp;gt;(% time)&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Steal&amp;lt;br&amp;gt;(% time)&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Guest In&amp;lt;br&amp;gt;(% time)&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Idle&amp;lt;br&amp;gt;(% time)&lt;br /&gt;
|-&lt;br /&gt;
! Description&lt;br /&gt;
| CPU number (or &amp;#039;&amp;#039;ALL&amp;#039;&amp;#039;)&amp;lt;br&amp;gt;Set with &amp;lt;code&amp;gt;-P &amp;lt;n&amp;gt;&amp;lt;/code&amp;gt; option switch&lt;br /&gt;
| CPU running user processes&lt;br /&gt;
| CPU running nice (adjusted priority) user processes&lt;br /&gt;
| CPU running kernel processes (excludes [[Acronyms#I|IRQ]]s)&lt;br /&gt;
| CPU waiting for (disk) IO &lt;br /&gt;
| CPU servicing hardware interrupts&lt;br /&gt;
| CPU servicing software interrupts&lt;br /&gt;
| Virtual CPU wait due to CPU busy with other [[Acronyms#V|vCPU]]&lt;br /&gt;
| CPU servicing vCPU(s)&lt;br /&gt;
| CPU idle&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;code&amp;gt; iostat &amp;lt;/code&amp;gt; ==&lt;br /&gt;
[http://www.linuxcommand.org/man_pages/iostat1.html &amp;lt;code&amp;gt;iostat&amp;lt;/code&amp;gt;] reports on IO (and CPU) stats.&lt;br /&gt;
&lt;br /&gt;
Its not available by default, and comes as part of the [http://sebastien.godard.pagesperso-orange.fr/ &amp;lt;code&amp;gt;sysstat&amp;lt;/code&amp;gt;] package (to install, use &amp;lt;code&amp;gt;apt-get install sysstat&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
IO stats can be displayed either by device (default, and extra metrics with &amp;lt;code&amp;gt;-x&amp;lt;/code&amp;gt; switch) or by partition (&amp;lt;code&amp;gt;-p&amp;lt;/code&amp;gt; switch).  Note that the first line of output contains average/total counts since system start, with subsequent output being for the period since the last line of output. &lt;br /&gt;
&lt;br /&gt;
Device stats output...&lt;br /&gt;
&amp;lt;pre&amp;gt;root@servername:~# iostat -x 5 3&lt;br /&gt;
Linux 2.6.32-41-server (servername)   25/07/12        _x86_64_        (1 CPU)&lt;br /&gt;
&lt;br /&gt;
avg-cpu:  %user   %nice %system %iowait  %steal   %idle&lt;br /&gt;
          11.56    0.54    2.17    6.67    0.00   79.06&lt;br /&gt;
&lt;br /&gt;
Device:         rrqm/s   wrqm/s     r/s     w/s   rsec/s   wsec/s avgrq-sz avgqu-sz   await  svctm  %util&lt;br /&gt;
sda              18.89     9.63    6.36    8.83   367.22   146.02    33.78     0.34   22.18   5.73   8.70&lt;br /&gt;
dm-0              0.00     0.00    3.16   10.68   190.37    86.53    20.01     0.62   44.79   2.18   3.02&lt;br /&gt;
dm-1              0.00     0.00   22.11    7.44   176.85    59.48     8.00     0.71   23.92   2.21   6.52&lt;br /&gt;
&lt;br /&gt;
avg-cpu:  %user   %nice %system %iowait  %steal   %idle&lt;br /&gt;
          45.18    0.00    5.02    0.40    0.00   49.40&lt;br /&gt;
&lt;br /&gt;
Device:         rrqm/s   wrqm/s     r/s     w/s   rsec/s   wsec/s avgrq-sz avgqu-sz   await  svctm  %util&lt;br /&gt;
sda               0.00     4.82    0.20    3.82     1.61    65.86    16.80     0.02    4.50   4.00   1.61&lt;br /&gt;
dm-0              0.00     0.00    0.20    8.23     1.61    65.86     8.00     0.07    7.86   1.90   1.61&lt;br /&gt;
dm-1              0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00   0.00   0.00&lt;br /&gt;
&lt;br /&gt;
avg-cpu:  %user   %nice %system %iowait  %steal   %idle&lt;br /&gt;
          95.80    0.00    4.20    0.00    0.00    0.00&lt;br /&gt;
&lt;br /&gt;
Device:         rrqm/s   wrqm/s     r/s     w/s   rsec/s   wsec/s avgrq-sz avgqu-sz   await  svctm  %util&lt;br /&gt;
sda               0.00    11.80    0.00    8.20     0.00   156.80    19.12     0.06    7.07   0.24   0.20&lt;br /&gt;
dm-0              0.00     0.00    0.00   19.60     0.00   156.80     8.00     0.18    8.98   0.10   0.20&lt;br /&gt;
dm-1              0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00   0.00   0.00 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Partition stats output...&lt;br /&gt;
&amp;lt;pre&amp;gt;root@servername:~# iostat -t -p 5 3&lt;br /&gt;
Linux 2.6.32-41-server (servername)   30/07/12        _x86_64_        (1 CPU)&lt;br /&gt;
&lt;br /&gt;
30/07/12 12:05:15&lt;br /&gt;
avg-cpu:  %user   %nice %system %iowait  %steal   %idle&lt;br /&gt;
           0.33    0.32    0.12    0.27    0.00   98.96&lt;br /&gt;
&lt;br /&gt;
Device:            tps   Blk_read/s   Blk_wrtn/s   Blk_read   Blk_wrtn&lt;br /&gt;
sda               1.12        13.57        14.71     721218     782038&lt;br /&gt;
sda1              0.00         0.02         0.00        804         14&lt;br /&gt;
sda2              0.00         0.00         0.00          4          0&lt;br /&gt;
sda5              0.91        13.54        14.71     719994     782024&lt;br /&gt;
dm-0              2.23        13.49        14.45     716850     768240&lt;br /&gt;
dm-1              0.04         0.05         0.26       2632      13784&lt;br /&gt;
&lt;br /&gt;
30/07/12 12:05:20&lt;br /&gt;
avg-cpu:  %user   %nice %system %iowait  %steal   %idle&lt;br /&gt;
           0.00    0.00    0.00    0.00    0.00  100.00&lt;br /&gt;
&lt;br /&gt;
Device:            tps   Blk_read/s   Blk_wrtn/s   Blk_read   Blk_wrtn&lt;br /&gt;
sda               1.20         0.00        14.40          0         72&lt;br /&gt;
sda1              0.00         0.00         0.00          0          0&lt;br /&gt;
sda2              0.00         0.00         0.00          0          0&lt;br /&gt;
sda5              0.80         0.00        14.40          0         72&lt;br /&gt;
dm-0              1.80         0.00        14.40          0         72&lt;br /&gt;
dm-1              0.00         0.00         0.00          0          0&lt;br /&gt;
&lt;br /&gt;
30/07/12 12:05:25&lt;br /&gt;
avg-cpu:  %user   %nice %system %iowait  %steal   %idle&lt;br /&gt;
           0.00    0.00    0.00    0.00    0.00  100.00&lt;br /&gt;
&lt;br /&gt;
Device:            tps   Blk_read/s   Blk_wrtn/s   Blk_read   Blk_wrtn&lt;br /&gt;
sda               0.00         0.00         0.00          0          0&lt;br /&gt;
sda1              0.00         0.00         0.00          0          0&lt;br /&gt;
sda2              0.00         0.00         0.00          0          0&lt;br /&gt;
sda5              0.00         0.00         0.00          0          0&lt;br /&gt;
dm-0              0.00         0.00         0.00          0          0&lt;br /&gt;
dm-1              0.00         0.00         0.00          0          0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;vwikitable-equal&amp;quot; &lt;br /&gt;
|+ Overview of IOSTAT Device Metrics&lt;br /&gt;
! Stats&lt;br /&gt;
! colspan=&amp;quot;10&amp;quot;| Device IO Stats&lt;br /&gt;
! colspan=&amp;quot;5&amp;quot;| Partition IO Stats&lt;br /&gt;
|-&lt;br /&gt;
! Code&lt;br /&gt;
! &amp;lt;code&amp;gt; rrqm/s &amp;lt;/code&amp;gt;&lt;br /&gt;
! &amp;lt;code&amp;gt; wrqm/s &amp;lt;/code&amp;gt;&lt;br /&gt;
! &amp;lt;code&amp;gt; r/s &amp;lt;/code&amp;gt;&lt;br /&gt;
! &amp;lt;code&amp;gt; w/s &amp;lt;/code&amp;gt;&lt;br /&gt;
! &amp;lt;code&amp;gt; rsec/s &amp;lt;/code&amp;gt;&lt;br /&gt;
! &amp;lt;code&amp;gt; wsec/s &amp;lt;/code&amp;gt;&lt;br /&gt;
! &amp;lt;code&amp;gt; avgrq-sz &amp;lt;/code&amp;gt;&lt;br /&gt;
! &amp;lt;code&amp;gt; avgqu-sz &amp;lt;/code&amp;gt;&lt;br /&gt;
! &amp;lt;code&amp;gt; svctm &amp;lt;/code&amp;gt;&lt;br /&gt;
! &amp;lt;code&amp;gt; %util &amp;lt;/code&amp;gt;&lt;br /&gt;
! &amp;lt;code&amp;gt; tps &amp;lt;/code&amp;gt;&lt;br /&gt;
! &amp;lt;code&amp;gt; Blk_read/s &amp;lt;/code&amp;gt;&lt;br /&gt;
! &amp;lt;code&amp;gt; Blk_wrtn/s &amp;lt;/code&amp;gt;&lt;br /&gt;
! &amp;lt;code&amp;gt; Blk_read &amp;lt;/code&amp;gt;&lt;br /&gt;
! &amp;lt;code&amp;gt; Blk_wrtn &amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! Name&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Read Merge&amp;lt;br&amp;gt;(/s)&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Write Merge&amp;lt;br&amp;gt;(/s)&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Read&amp;lt;br&amp;gt;(/s)&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Write&amp;lt;br&amp;gt;(/s))&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Read&amp;lt;br&amp;gt;(sectors/s)&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Write&amp;lt;br&amp;gt;(sectors/s)&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Av. Req. Size&amp;lt;br&amp;gt;(sectors)&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Av. Queue Len.&amp;lt;br&amp;gt;(sectors)&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Av. Service Time&amp;lt;br&amp;gt;(msec)&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Utilisation&amp;lt;br&amp;gt;(% CPU Time)&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Transfers&amp;lt;br&amp;gt;(/s)&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Read&amp;lt;br&amp;gt;(blocks/s)&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Write&amp;lt;br&amp;gt;(blocks/s)&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Read&amp;lt;br&amp;gt;(blocks)&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Write&amp;lt;br&amp;gt;(blocks)&lt;br /&gt;
|-&lt;br /&gt;
! Description&lt;br /&gt;
| Read requests merged&lt;br /&gt;
| Write requests merged&lt;br /&gt;
| Read requests&lt;br /&gt;
| Write requests&lt;br /&gt;
| Sector reads&lt;br /&gt;
| Sector writes&lt;br /&gt;
| Average read/write request size&lt;br /&gt;
| Average request queue length&lt;br /&gt;
| Average time to service requests&lt;br /&gt;
| Bandwidth utilisation / device saturation&lt;br /&gt;
| IO transfer rate (TPS - Transfers Per Second)&lt;br /&gt;
| Data read&lt;br /&gt;
| Data write&lt;br /&gt;
| Data read&lt;br /&gt;
| Data write&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If when using the above tools you&amp;#039;re presented with disk/devices names of &amp;lt;code&amp;gt;dm-0&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;dm-1&amp;lt;/code&amp;gt;, etc., which won&amp;#039;t mean much.  These are LVM logical devices, to understand what they map to use&lt;br /&gt;
&amp;lt;pre&amp;gt;lvdisplay|awk  &amp;#039;/LV Name/{n=$3} /Block device/{d=$3; sub(&amp;quot;.*:&amp;quot;,&amp;quot;dm-&amp;quot;,d); print d,n;}&amp;#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Ubuntu]]&lt;br /&gt;
[[Category:Troubleshooting]]&lt;br /&gt;
[[Category:Bash]]&lt;/div&gt;</summary>
		<author><name>Sstrutt</name></author>
	</entry>
</feed>