vmstat Command
Purpose
Reports virtual memory statistics.
Syntax
vmstat [ -f ] [ -i ] [ -s ] [ -I[-W]] [ -t ] [ -v ] [ -h ] [ -w ] [ -l ] [-c] [ -@ wparname | ALL] [{ -p | -P } physicalvolume | ALL] ALL] [-S
power] [physicalvolume]
[interval] [count]
Description
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.
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:
- lcpu
- Indicates the number of logical processors.
- mem
- Indicates the amount of memory.
- tmem
- Indicates the true memory size of the LPAR. Note: This flag is available only when -c option is provided and Active Memory Expansion is enabled.
- ent
- Indicates the entitled capacity. Displays only when the partition is running with shared processor.
- drives
- Indicates the number of disks. 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 with 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 with 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 a 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.
- WPAR
- Workload partition name. Notes:
- The system WPAR name indicates system-wide statistics. The global WPAR name indicates the statistics belong to Global only.
- When the vmstat command is started with the -@ ALL option and the WPAR specific information is not available for a metric, then an en dash sign (-) is displayed instead of a value.
- When the vmstat command is started with the -@ wparname or started inside a WPAR, if the WPAR information is not available for a metric, then that metric is marked with the at sign (@), and the system-wide value is displayed for that metric.
- If a metric is not supported, then a en dash sign (-) is displayed instead of a value.
kthr: Information about kernel thread states.
- 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 that are 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 are accessed. A page is 4096 bytes.
- avm
- Active virtual pages.
- fre
- Size of the free list. Note: A large portion of real memory is used 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. This information is averaged over the interval and given in units per second.
- re
- Pager input/output list.
- pi
- Pages that are paged in from paging space.
- po
- Pages paged out to paging space.
- fr
- Pages freed (page replacement).
- sr
- Pages that are scanned by page-replacement algorithm.
- cy
- Clock cycles by page-replacement algorithm.
Faults: Trap and interrupt rate averages per second over the sampling interval.
- in
- Device interrupts.
- sy
- System calls.
- cs
- Kernel thread context switches.
CPU: Breakdown of percentage usage of processor time.
- us
- User 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).
- sy
- System 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).
- id
- Processor idle 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).
- wa
- Processor idle time during which the system had outstanding disk/NFS
I/O request.
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).
- pc
- Number of physical processors used. Displayed only if the partition is running with shared processor.
- ec
- The percentage of entitled capacity that is 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 used. This information is displayed only for the WPARs with 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.
- kthr
- The p column is displayed in addition to the r and b columns.
- p
- Average number of threads waiting for I/O messages
from raw devices. Raw devices are the devices that are directly attached
to the system.
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.
- w
- Number of threads per second of time that are
waiting for the file system direct I/O event to occur. These events
include the following types:
- Asynchronous I/O (AIO)
- Buffer cache subsystem
- Concurrent I/O (CIO)
- File system direct I/O
- NFS subsystem
- A thread is waiting for an action from the virtual memory manager (VMM) waiting list.
- page
- New fi and fo columns are displayed instead of the re and cy columns.
- fi
- File page-ins per second.
- fo
- File page-outs per second.
If the -c flag is specified, Active Memory Expansion view is presented with the following column changes.
- memory
- The columns csz, cfr, and dxm are displayed
besides columns avm and fre.
- csz
- Current compressed pool size, in 4K page units.
- cfr
- Free pages available in compressed pool, in 4K page units.
- dxm
- Deficit in Expanded Memory Size, in 4K page units.
- page
- New columns ci and co are displayed instead of re and cy columns.
- ci
- Number of page-ins per second from compressed pool.
- co
- Number of page-outs per second to compressed pool.
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.
- alp
- Indicates the number of large pages currently in use.
- flp
- Indicates the number of large pages on the large page freelist.
- avm
- fre
- re
- fi
- fo
- pi
- po
- ci
- co
- fr
- sr
- cy
- The display of the re, fi, fo, and cy options are affected by the -I option.
- The display of the re, ci, co, and cy options are affected by the -c option.
- If there is no resource control, then the avm and fre options are system-wide. Therefore, with the -@ option set, both the avm and fre options will be marked with the at sign (@).
- psz
- Page size (for example, 4 KB, 64 KB).
- siz
- Number of frames of the specified page size that exist on the system.
- pgsz
- Indicates the page size (for example, 4 KB, 64 KB).
- Memory
- Indicates the memory statistics for the specified page sizes.
- siz
- The number of frames of the specified page size that exist on the system.
- avm
- Active virtual pages applicable to the specified page size.
- fre
- Size of the free list for the specified page size.
- Page
- Indicates the relevant page faults and paging activity for the specified page size. The page-related columns re, pi, po, fr, sr, cy, fi, fo, ci, and co are also applicable to this report.
Flags
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 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. |
- If Active Memory Expansion is enabled, the vmstat reports memory statistics in the expanded view. However, if the environment variable AME_MEMVIEW is set to TRUE, the memory statistics represent the true view.
- The AME_MEMVIEW environment variable has no impact on memory statistics reported using the -c option.
Examples
- To display a summary of the statistics since boot, enter the following
command:
vmstat
- To display five summaries at 2-second intervals, enter the following
command:
vmstat 2 5
- To display a summary of the statistics since boot including statistics
for logical disks scdisk13 and scdisk14, enter the following command:
vmstat scdisk13 scdisk14
- To display fork statistics, enter the following command:
vmstat -f
- To display the count of various events, enter the following command:
vmstat -s
- To display time-stamp next to each column of output of vmstat,
enter the following command:
vmstat -t
- To display the I/O oriented view with an alternative set of columns,
enter the following command:
vmstat -I
- To display all the VMM statistics available, enter the following
command:
vmstat -vs
- To display the large-page section with the
alp
andflp
columns at 8-second intervals, enter the following command:vmstat -l 8
- To display the VMM statistics specific to a particular page size
(in the example, 4 KB), enter the following command:
vmstat -p 4K
- To display the VMM statistics for all page sizes that are supported
on the system, enter the following command:
Or enter the following command:vmstat -p ALL
vmstat -p all
- To display only the VMM statistics for a particular page size
(in this example, 4 KB), enter the following command:
vmstat -P 4K
- To display only the per-page breakdown of VMM statistics for all
supported page sizes, enter the following command:
Or enter the following command:vmstat -P ALL
vmstat -P all
- To display a summary of the statistics for all of the workload partitions after boot,
enter the following command:
vmstat -@ ALL
- To display all of the VMM statistics available for all of the workload partitions, enter the
following command:
vmstat –vs -@ ALL
- To display both WPAR and
system-wide VMM statistics from a workload partition, enter the following
command:
vmstat -@
- To multiply the processor values with 10 and display the results,
enter the following command:
vmstat -S 1
- To display the statistics for the hypervisor page, enter the following
command:
vmstat –h
- To display the information about pages that are loaned to the
hypervisor, enter the following command:
vmstat -vh
- To display memory compression statistics (in an LPAR with Active Memory Expansion
enabled), enter the following command:
vmstat -c
- To display memory compression statistics specific to per-pagesize
(in an LPAR with Active
Memory Expansion enabled), enter the following command:
vmstat –c –P ALL
- To append memory compression information to the statistics displayed
by -soption (in an LPAR with Active Memory Expansion enabled), enter
the following command:
vmstat –s -c
- To append memory compression information to the statistics displayed
by -voption (in an LPAR with Active Memory Expansion enabled), enter
the following command:
vmstat –v -c
Files
Item | Description |
---|---|
/usr/bin/vmstat | Contains the vmstat command. |