Reports virtual memory statistics.
vmstat [ -f ] [ -i ] [ -s ] [ -I[-W]] [ -t ] [ -v ] [ -h ] [ -w ] [ -l ] [-c] [ -@ wparname | ALL] [{ -p | -P } physicalvolume | ALL] ALL] [-S power] [physicalvolume] [interval] [count]
The vmstat command reports statistics about kernel threads, virtual memory, disks, hypervisor pages, traps, and processor activity. Reports that are generated by the vmstat command can be used to balance system load activity. These system-wide statistics (among all processors) are calculated as averages for values that are expressed as percentages, and as sums otherwise. The vmstat command might return inconsistent statistics because the statistics are not read atomically.
If you run the vmstat command without flags, the report contains a summary of the virtual memory activity since system startup. If you specify the -f flag, the vmstat command reports the number of forks since system startup. The physicalvolume parameter specifies the name of the physical volume.
The interval parameter specifies the amount of time in seconds between each report. If you do not specify the interval parameter, the vmstat command generates a single report that contains statistics for the time since system startup and then exits. You can specify the count parameter only with the interval parameter. If you specify the count parameter, its value determines the number of reports that are generated and the number of seconds apart. If you specify the interval parameter without the count parameter, reports are continuously generated. Do not specify a value of zero to the count parameter.
The kernel maintains statistics for kernel threads, paging, and interrupt activity, which the vmstat command accesses by using the perfstat kernel extension. The disk input/output statistics are maintained by device drivers. For disks, the average transfer rate is determined by using the active time and number of times information is being transferred. The percent active time is computed from the amount of time the drive is busy during the report.
Beginning with AIX® 5.3, the vmstat command reports the number of physical processors consumed (pc), and the percentage of entitlement consumed (ec), in Micro-Partitioning® environments. These metrics display on the Micro-Partitioning environments.
The report that is generated by the vmstat command contains a system configuration row and column headings. If the -@ flag is specified, the report consists of system configuration and WPAR configuration. The system configuration row has the following values:
The column headings and their descriptions follow:
WPAR: Information about workload partitions. It displays only when the-@ flag is specified.
kthr: Information about kernel thread states.
Memory: Information about the usage of virtual and real memory. Virtual pages are considered active if they are accessed. A page is 4096 bytes.
Page: Information about page faults and paging activity. This information is averaged over the interval and given in units per second.
Faults: Trap and interrupt rate averages per second over the sampling interval.
CPU: Breakdown of percentage usage of processor time.
If the current physical processor consumption of the uncapped partitions exceeds the entitled capacity, the percentage becomes relative to the number of physical processor consumed (pc).
If the current physical processor consumption of the uncapped partitions exceeds the entitled capacity, the percentage becomes relative to the number of physical processor consumed (pc).
If the current physical processor consumption of the uncapped partitions exceeds the entitled capacity, the percentage becomes relative to the number of physical processor consumed (pc).
If the current physical processor consumption of the uncapped partitions exceeds the entitled capacity, the percentage becomes relative to the number of physical processor consumed (pc).
Disk: Provides the number of transfers per second to the specified physical volumes that occurred in the sample interval. Thephysicalvolume parameter can be used to specify one to four names. Transfer statistics are given for each specified drive in the order specified. This count represents requests to the physical device. It does not imply an amount of data that was read or written. Several logical requests can be combined into one physical request. If the physicalvolume parameter is used, the physical volume names are printed at the beginning of command execution.
If the -I flag is specified, an I/O oriented view is presented with the following column changes.
If the -W flag is specified along with the -I flag, an additional w column is also displayed along with the r, b, and p flags.
If the -c flag is specified, Active Memory Expansion view is presented with the following column changes.
If while the vmstat command is running, there is a change in system configuration that affects the output, vmstat prints a warning message about the configuration change. It then continues the output after printing the updated system configuration information and the header.
| Flag name | Description |
|---|---|
| -@ wparname | Reports the Virtual Memory activity of a workload partition:
|
| -c | Displays memory compression statistics with
the new columns of output, csz, cfr, and dxm under
the heading memory, and columns ci and co under the
heading page instead of the columns re and cy. Note: This
option is available only when Active
Memory Expansion is enabled.
|
| -f | Reports the number of forks since system startup. |
| -i | Displays the number of interrupts that are taken by each device
since system startup. Note: The -I, -t, -w, and -l flags
are ignored when they are specified with the -i flag.
|
| -I | Displays I/O oriented view with the new columns of output, p under heading kthr,and columns fi and fo under heading page instead of the columns re and cy in the page heading. |
| -l | Displays an extra "large-page" section with the alp and flp columns. |
| -p pagesize | Appends the VMM statistics for the specified page size to the regular vmstat output. |
| -P pagesize | Displays only the VMM statistics, which are relevant for the specified page size. |
| -s | Writes to standard output the contents of the sum structure,
which contains an absolute count of paging events since system initialization.
The -s flag can only be used with the -v flag. These
events are described as follows:
|
| -s |
|
| -s |
|
| -s | When used with the -p pagesize option, the -s option appends the sum structure for the specified page size to the system-wide sum structure. This additional stanza is preceded by a page size header (for example, 4K pages). The following details are not be displayed in this pagesize-based stanza as these statistics are not related to page sizes:
Notes:
|
| -S power | Multiplies the statistics of the processor with a value of
10power. The default value of the power is 0. The following
statistics are scaled:
Notes:
|
| -t | Prints the time-stamp next to each line of output of vmstat.
The time-stamp is displayed in the HH:MM:SS format. Note: Time
stamp is not be printed if -f, -s, or -i flags
are specified.
|
| -v | Writes to standard output various statistics maintained by
the Virtual Memory Manager. The -v flag can only be used with
the -s and the -h flags. If you specify the -v flag, the following statistics are displayed:
|
| -v | (Statistics that are displayed by -v, continued):
If you specify the -h flag with the -v flag, the following additional metrics are displayed:
Notes:
When the -c flag is specified along with the -v flag,
the following additional metrics are displayed:
|
| -h | Displays the hypv-page section that includes the hypervisor
page information. The hypv-page section contains the following
metrics:
If you specify the -h flag with the -v flag, the following metrics are displayed in addition to the metrics that are displayed using the -v flag:
|
| -w | Displays the report in wide mode. |
| -W | Displays an extra field w in the kthr section. This option is allowed only with -I flag. |
Any user can run the vmstat command. If the user is not a root user, the view will be limited to the user's own processes.
If RBAC is activated and the vios.system.stat.memory role is attributed to the user, then that user can see the same view that the root user does.
vmstat
vmstat 2 5
vmstat scdisk13 scdisk14
vmstat -f
vmstat -s
vmstat -t
vmstat -I
vmstat -vs
vmstat -l 8
vmstat -p 4K
vmstat -p ALL
Or
enter the following command: vmstat -p all
vmstat -P 4K
vmstat -P ALL
Or
enter the following command: vmstat -P all
vmstat -@ ALL
vmstat –vs -@ ALL
vmstat -@
vmstat -S 1
vmstat –h
vmstat -vh
vmstat -c
vmstat –c –P ALL
vmstat –s -c
vmstat –v -c
| Item | Description |
|---|---|
| /usr/bin/vmstat | Contains the vmstat command. |