VMSTAT
vmstat command reports information about processes, memory, paging, block IO, traps, and cpu activity. However, a real advantage of vmstat command output – is to the point and (concise) easy to read/understand. The output of vmstat command use to help identify system bottlenecks. The details related with each field in the output is given in the man pages and hence I just try to explain the result. For more detailed explanation refer the man pages. vmstat output explained here with an example
A sample vmstat output would look like this.
# vmstat -S M 1 10 procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu------ r b swpd free buff cache si so bi bo in cs us sy id wa st 6 0 1 905 462 15205 0 0 59 116 0 0 49 6 44 1 0 4 0 1 955 462 15206 0 0 212 0 2479 11962 23 4 72 1 0 4 1 1 1033 462 15206 0 0 72 2560 2479 4638 21 3 76 0 0 6 3 1 1045 462 15206 0 0 804 812 2760 8050 32 4 61 3 0
Ideally r/b values under “procs” block with close to 0 or 0 itself. If one or value counter values are constantly reporting high values, it means that system may not have sufficient CPU or Memory or I/O bandwidth.
If value of swpd under swap is too high and it keeps changing, the it means that system is running short of memory.
The data under “io” indicates the flow of data to and from the disks. This shows how much disk activity is going on, which does not necessarily indicate some problem(obviously data has to go to disk in order to be persistent). If we see some large number under “proc” and then “b” column (processes being blocked) and high I/O, the issue could be a I/O contention.