Vmstat

From HPCWIKI
Revision as of 12:50, 3 January 2024 by Admin (talk | contribs) (Created page with "The '''<code>vmstat</code>''' (virtual memory statistics) is a built-in monitoring utility in Linux. <ref>https://phoenixnap.com/kb/vmstat-command</ref> The command is used to obtain information about memory, system processes, paging, interrupts, block I/O, disk, and CPU scheduling. Users can observe system activity virtually in real-time by specifying a sampling period. == Output meaning == <syntaxhighlight lang="bash"> $ vmstat -n 1 procs -----------memory----------...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

The vmstat (virtual memory statistics) is a built-in monitoring utility in Linux. [1]

The command is used to obtain information about memory, system processes, paging, interrupts, block I/O, disk, and CPU scheduling. Users can observe system activity virtually in real-time by specifying a sampling period.

Output meaning

$ vmstat -n 1
procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu-----
 r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st
 0  0  22116 182900  35548 378464    0    0     4     3    1   30  0  0 100  0  0
 0  0  22116 182904  35548 378480    0    0     0     0    0   44  0  0 100  0  0
 0  0  22116 182904  35548 378480    0    0     0     0    2   41  0  0 100  0  0
 0  0  22116 182904  35548 378480    0    0     0     0    0   49  0  0 100  0  0
 0  0  22116 182904  35548 378480    0    0     0     0    2   45  0  0 100  0  0
 0  0  22116 182904  35548 378480    0    0     0     0    0   46  0  0 100  0  0
 0  0  22116 182892  35556 378472    0    0     0    20    2   64  0  0 99  1  0
 0  0  22116 182896  35556 378480    0    0     0     0    0   44  0  0 100  0  0
Section Meaning Notes
procs rActive process count.

bSleeping process count.

memory swpd – Total virtual memory. The swap space is initially unoccupied. However, the kernel starts using swap space as the system’s physical memory reaches its limit.

free – Total free memory.

buff – Total memory temporarily used as a data buffer.

cache – Total cache memory

swap si – The rate of swapping-in memory from disk.

so – The rate of swapping-out memory to disk.

o bi – Blocks received from a block device per second.

bo – Blocks sent to a block device per second.

system in – The number of system interrupts.

cs – The number of context switches per second.

cpu us – The percentage of CPU time spent on non-kernel processes.

sy – The percentage of CPU time spent on kernel processes.

id – The percentage of idle CPU.

wa – The percentage of CPU time spent waiting for Input/Output.

st – The percentage of CPU time stolen by a virtual machine.

  • The connection queue length is displayed in the “wa” column, which stands for “wait”. This value represents the number of processes that are waiting for a resource, such as a connection. If the value in the “wa” column is high, it could indicate that the server is experiencing a high load and may be unable to handle additional connections efficiently. In this case, increasing its capacity to handle the load by e.g. upgrading the hardware/network capacity for your website is recommended.

References