vmstat command is used for performance monitoring of the system in Linux. It basically lists all the information such as processes, memory, swap, io, CPU, and system. Because of these functions, the vmstat command is also known as a virtual memory statistics report.
The values reported by the command are the average for each statistic since the computer was last restarted. These figures are not current values.
Here at LinuxAPT, as part of our Server Management Services, we regularly help our Customers to perform related Linux system commands.
In this context, we shall look into how to use the vmstat command in Linux.
vmstat Command syntax takes the following form:
$ vmstat [options][delay [count]]
As per the output, the following should be noted:
-a show active and inactive memory of the running system and its command is:
$ vmstat -a
-f shows the number of forks with the command:
$ vmstat -f
-m show Slabinfo with the below command:
$ vmstat -m
-s memory statistics and show event counter with the below command:
$ vmstat -s
-d show drive statistics with the below command:
$ vmstat -d
This article covers how to use the vmstat command in Linux. In fact, vmstat command in Linux/Unix is a performance monitoring command of the system as it gives the information about processes, memory, paging, block IO, disk, and CPU scheduling. All these functionalities makes the command vmstat also known as virtual memory statistic reporter.