Reports virtual memory statistics.
vmstat [ -f ] [ -i ] [ -s ] [ -I[-W]] [ -t ] [ -v ] [ -h ] [ -w ] [ -l ] [-c] [ -@ wparname | ALL ] [ { -p | -P } pagesize | 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 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 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 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.
AIX® 4.3.3 and later contain enhancements to the method used to compute the percentage of processor time spent waiting on disk I/O (wio time). The method used in AIX 4.3.2 and earlier versions of the operating system can, under certain circumstances, give an inflated view of wio time on SMPs.
The method used in AIX 4.3.2 and earlier versions is as follows: At each clock interrupt on each processor (100 times a second per processor), a determination is made as to which of the four categories (usr/sys/wio/idle) to place the last 10 ms of time. If the processor was busy in usr mode at the time of the clock interrupt, then usr gets the clock tick added into its category. If the processor was busy in kernel mode at the time of the clock interrupt, then the sys category gets the tick. If the processor was not busy, a check is made to see if any I/O to disk is in progress. If any disk I/O is in progress, the wio category is incremented. If no disk I/O is in progress and the processor is not busy, the idle category gets the tick. The inflated view of wio time results from all idle processors being categorized as wio regardless of the number of threads waiting on I/O. For example, systems with just one thread doing I/O could report over 90 percent wio time regardless of the number of processors it has. The wio time is reported by the commands sar (%wio), vmstat (wa) and iostat (% iowait).
The kernel maintains statistics for kernel threads, paging, and interrupt activity, which the vmstat command accesses through the use of 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 transfers information. 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 will only be displayed on Micro-Partitioning environments.
The report generated by the vmstat command contains a system configuration row and column headings. If the -@ flag is specified, the report will consist of system configuration and WPAR configuration. The system configuration row has the following values:
Item | Description |
---|---|
lcpu | Indicates the number of logical processors. |
mem | Indicates the amount of memory. |
tmem | Indicates the true memory size of the LPAR.
Note: This is available only when -c option is provided and Active Memory™ Expansion
is enabled.
|
ent | Displays only when the partition is running with shared processor. |
drives | Displays only when physical volume name is monitored. |
WPARs | Indicates the number of active workload partitions. It is displayed only when the -@ flag is specified. |
memlim | Indicates the limit of the memory resource of the workload partition. The limit is in megabytes (MB). This information is displayed only for the WPAR that has enforced memory resource limit. |
cpulim | Indicates the limit of processor resource of the workload partition in processor units. This information is displayed only for the WPAR that has enforced processor resource limit. |
rset | Indicates the type of the rset registry that is associated with a WPAR. The type can be regular or exclusive. This information is displayed only for the WPARs that are associated with an rset registry. |
mmode | Indicates memory mode. This metric is displayed automatically in a system with Active Memory Sharing enabled. This metric is also displayed when -c option is used. |
mpsz | Size of the memory pool in gigabytes. This metric is displayed only in shared-memory mode. |
The column headings and their descriptions follow:
WPAR: Information about workload partitions. It displays only when the -@ flag is specified.
Item | Description |
---|---|
WPAR | Workload partition name. Notes:
|
kthr: Information about kernel thread states.
Item | Description |
---|---|
r | Average number of runnable kernel threads over the sampling interval. Runnable threads consist of the threads that are ready but still waiting to run, and the threads that are already running. |
b | Average number of kernel threads placed in the Virtual Memory Manager (VMM) wait queue (awaiting resource, awaiting input/output) over the sampling interval. |
Memory: Information about the usage of virtual and real memory. Virtual pages are considered active if they have been accessed. A page is 4096 bytes.
Item | Description |
---|---|
avm | Active virtual pages. |
fre | Size of the free list. Note: A large portion of real memory
is utilized as a cache for file system data. It is not unusual for
the size of the free list to remain small.
|
Page: Information about page faults and paging activity. These are averaged over the interval and given in units per second.
Item | Description |
---|---|
re | Pager input/output list. |
pi | Pages paged in from paging space. |
po | Pages paged out to paging space. |
fr | Pages freed (page replacement). |
sr | Pages scanned by page-replacement algorithm. |
cy | Clock cycles by page-replacement algorithm. |
Faults: Trap and interrupt rate averages per second over the sampling interval.
Item | Description |
---|---|
in | Device interrupts. |
sy | System calls. |
cs | Kernel thread context switches. |
CPU: Breakdown of percentage usage of processor time.
Item | Description |
---|---|
us | User time. |
sy | System time. |
id | Processor idle time. |
wa | Processor idle time during which the system had outstanding disk/NFS I/O request(s). See detailed description above. |
pc | Number of physical processors consumed. Displayed only if the partition is running with shared processor. |
ec | The percentage of entitled capacity consumed. Displayed only if the partition is running with shared processor. Because the time base over which this data is computed can vary, the entitled capacity percentage can sometimes exceed 100%. This excess is noticeable only with small sampling intervals. |
rc | The percentage of processor resource that is consumed. This information is displayed only for the WPARs that have enforced processor resource limit. |
Disk: Provides the number of transfers per second to the specified physical volumes that occurred in the sample interval. The physicalvolume 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.
Item | Description |
---|---|
kthr | The p column is displayed in addition to the r and b columns.
|
page | New fi and fo columns will be displayed instead
of the re and cy columns.
|
If the -c flag is specified, Active Memory Expansion view is presented with the following column changes.
Item | Description |
---|---|
memory | The columns csz, cfr,
and dxm will be displayed besides columns avm and fre.
|
page | New columns ci and co will
be displayed instead of re and cy columns.
|
If, while the vmstat command is running, there is a change in system configuration that will affect 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.
Item | 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 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 additional "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 will 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 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 additional field w in the kthr section. This option is allowed only with -I flag. |
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. |