Vmstat
Last updated
Was this helpful?
Last updated
Was this helpful?
* running cpu, block cpu
* r: The number of processes waiting for run time.
* b: The number of processes in uninterruptible sleep.
* memory usage
* swap
* io - input/ouput
* bi - Blocks received from a block device (blocks/s)
* bo - Blocks sent to a block device (blocks/s).
* system -
* in - The number of interrupts per second, including the clock.
* cs - The number of context switches per second.
* cpu -
* wa: Time spent waiting for IO
* sy: Time spent running kernel code. (system time)
* us: Time spent running non-kernel code. (user time, including nice time)
* -d show disk reads/wirtes/IO
vmstat 2 10
- To execute every 2 seconds for 10 times
root@shubuntu ~ vmstat 2 10 ✔ ⚡ 79 06:19:23
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 0 75604 62252 678656 0 0 3 1 2 2 0 0 100 0 0
0 0 0 75572 62252 678656 0 0 0 0 8326 59 0 0 100 0 0
0 0 0 75416 62260 678648 0 0 0 18 8332 73 0 0 100 0 0
0 0 0 75416 62260 678652 0 0 0 0 8318 54 0 0 100 0 0
0 0 0 75480 62260 678660 0 0 0 0 8360 83 0 0 100 0 0
0 0 0 75480 62260 678660 0 0 0 0 8343 70 0 0 100 0 0
0 0 0 75448 62260 678660 0 0 0 0 8314 50 0 0 100 0 0
0 0 0 75448 62260 678660 0 0 0 0 8316 53 0 0 100 0 0
0 0 0 75448 62260 678660 0 0 0 0 8317 54 0 0 100 0 0
0 0 0 75448 62260 678660 0 0 0 0 8387 98 0 0 100 0 0
vmstat -d
Use option -d to display the disk statistics as shown below. This displays the reads, writes, and I/O statistics of the disk.
disk- ------------reads------------ ------------writes----------- -----IO------
total merged sectors ms total merged sectors ms cur sec
loop246 0 0 0 0 0 0 0 0 0 0
loop247 0 0 0 0 0 0 0 0 0 0
loop248 0 0 0 0 0 0 0 0 0 0
loop249 0 0 0 0 0 0 0 0 0 0
loop250 0 0 0 0 0 0 0 0 0 0
loop251 0 0 0 0 0 0 0 0 0 0
loop252 0 0 0 0 0 0 0 0 0 0
loop253 0 0 0 0 0 0 0 0 0 0
loop254 0 0 0 0 0 0 0 0 0 0
loop255 0 0 0 0 0 0 0 0 0 0
mmcblk0 530279 59623 81553879 10060460 435303 483137 75710389 160397208 0 6750
vmstat -w 1 3
Use option -w to increase the width of the output columns as shown below. This give better readability.
[root@test-101 ~]# vmstat -w 1 3
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 0 380824 128092 112736 0 0 2 23 2 1 1 0 99 0 0
0 0 0 380800 128092 112736 0 0 0 0 122 107 0 0 100 0 0
0 0 0 380800 128092 112736 0 0 0 0 99 108 0 0 100 0 0
vmstat -s
[root@-test-101 ~]# vmstat -s
3924252 total memory
3543552 used memory
769468 active memory
67748 inactive memory
380700 free memory
128096 buffer memory
112736 swap cache
0 total swap
0 used swap
0 free swap
8481222 non-nice user cpu ticks
7592 nice user cpu ticks
3207888 system cpu ticks
1483602447 idle cpu ticks
4182278 IO-wait cpu ticks
315 IRQ cpu ticks
62822 softirq cpu ticks
0 stolen cpu ticks
35727801 pages paged in
337614829 pages paged out
0 pages swapped in
0 pages swapped out
884076676 interrupts
1003530568 CPU context switches
1558424336 boot time
1229129 fork