[LINUX] How to Monitor System Performance

You can use the vmstat command to monitor system performance in real-time. vmstat is a tool able to collect stats about system’s memory and processor resource utilization in real time. In order to have an always-active monitoring shell, prepend the watch command to the vmstat command:

~$ watch vmstat -a -S M
Every 2.0s: vmstat -a -S M

procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu-----
 r  b   swpd   free  inact active   si   so    bi    bo   in   cs us sy id wa st
 0  0      0   2961    268    358    0    0   145    38   75  119  0  0 97  2  0

Furthermore, if you’d like to specifically monitor disk reads/writes, you can execute the following command:

~$ watch vmstat -d
Every 2.0s: vmstat -d

disk- ------------reads------------ ------------writes----------- -----IO------
       total merged sectors      ms  total merged sectors      ms    cur    sec
sr0        0      0       0       0      0      0       0       0      0      0
sda    24616   4031  867336  196140   2424  10626  227728 1087716      0     54

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.