vmstat Command
Purpose
Reports virtual memory statistics.
Syntax
vmstat [ -f ] [ -i ] [ -s ] [ -I [ -W ]] [ -t ] [ -v ] [ -h ] [ -w ] [ -l ] [ -c ] [ -L level ] [ -@ wparname | ALL ] [{ -p | -P } physicalvolume | ALL ] ALL ] [ -S power ] [ physicalvolume ] [ interval ] [ count ]
Description
The vmstat command reports the statistics of the kernel threads, virtual memory, disks, hypervisor pages, traps, and processor activity. The reports that are generated by the vmstat command are used to balance the system load activity. These system-wide statistics are calculated as averages when values are expressed as percentages across all processors, and are calculated as sums in other cases. The vmstat command might return inconsistent statistics if the statistics are not read atomically.
If you run the vmstat command without specifying any flags, the vmstat command 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, the count parameter 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 the statistics for kernel threads, paging, and interrupt activity, which the vmstat command can access by using the perfstat kernel extension. The disk input/output (I/O) statistics are maintained by the device drivers. For disks, the average transfer rate is determined by using the active time and number of times information is being transferred. The % 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.
The report that is generated by the vmstat command contains a system configuration row and the column headings. If the -@ flag is specified, the vmstat command report consists the system configuration and WPAR configuration.
System configuration row
- lcpu
- The lcpu field indicates the number of logical processors.
- mem
- The mem field indicates the amount of memory.
- tmem
- The tmem field indicates the true memory size of the Logical partition
(LPAR). Note: This flag is available only when -c option is provided and the Active Memory Expansion is enabled.
- ent
- The ent field indicates the entitled capacity. This information is displayed only when you run the partition on a shared processor.
- drives
- The drives field indicates the number of disks. This information is displayed only when the physical volume name is monitored.
- Workload Partitions (WPARs)
- The WPARs field indicates the number of active workload partitions. This information is displayed only when you specify the -@ flag.
- memlim
- The memlim field indicates the limit (in megabytes) of the memory resource of the workload partition. This information is displayed only for the WPAR with enforced memory resource limit.
- cpulim
- The cpulim field 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
- The rset field indicates the type of the rset registry that is associated with a WPAR. The rset registry type can be of type regular or exclusive. This information is displayed only for the WPARs that are associated with a rset registry.
- mmode
- The mmode field indicates the memory mode. This metric is displayed automatically when Active Memory Sharing is enabled on a system. This metric is also displayed when you specify a -c option.
- mpsz
- The mpsz field indicates the size of the memory pool in gigabytes. This metric is displayed only in a shared-memory mode.
Column headings
The column headings of the report that is generated by the vmstat command has the following values:
- WPAR
- WPAR is the Workload partition name and provides information about the
workload partitions. This information is
displayed only when you specify the -@ flag.Notes:
- The system WPAR name indicates the system-wide statistics and the global WPAR name indicates that the statistics belong to Global only.
- When you start the vmstat command with the -@ ALL option and the WPAR specific information is not available for a metric, an en dash sign (-) is displayed instead of a value.
- When you start the vmstat command with the -@ wparname or 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
-
Provides information about the kernel thread states.
r- Represents the average number of kernel threads that can run over the sampling interval. The kernel threads that can run over the sampling interval consist of the threads that are ready but still waiting to run, and the threads that are already running.
b- Represents the average number of kernel threads that are placed in the Virtual Memory Manager (VMM) wait queue (awaiting resource, awaiting I/O) over the sampling interval.
- Memory
-
Provides information about the usage of virtual and real memory. The virtual pages are considered to be active if they are accessed. A virtual page is 4096 bytes.
avm- Indicates the number of active virtual pages.
fre- Indicates the size of the free list. Note: A large portion of real memory is used as a cache for file system data. The size of the free list remains small.
- Page
-
Provides information about the page faults and paging activity. This information is averaged over the interval and displayed in units per second.
re- Indicates the I/O list of the pager.
pi- Indicates the pages that are paged in from paging space.
po- Indicates the pages that paged out to paging space.
fr- Indicates the pages that are freed (page replacement).
sr- Indicates the pages that are scanned by a page-replacement algorithm.
cy- Indicates the clock cycles by page-replacement algorithm.
- Faults
-
Provides information about average rate of trap and interrupt rate per second over the sampling interval.
in- Indicates the device interrupts.
sy- Indicates the system calls.
cs- Indicates the kernel thread context switches.
- CPU
-
Provides information about breakdown of percentage usage of processor time.
us- Indicates the 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 processors consumed.
sy- Indicates the 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 processors consumed.
id- Indicates the 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 processors consumed.
wa- Indicates the processor idle time during which the system had an outstanding disk or 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 processors consumed.
pc- Indicates the number of physical processors that are used. This information is displayed only when you run a partition on a shared processor.
ec- Indicates the percentage of entitled capacity that is consumed. This information is displayed only when you run a partition on a shared processor. As the time base over which this data is computed can vary, the entitled capacity percentage can sometimes exceed 100% and the excess is noticeable only with small sampling intervals.
rc- Indicates the percentage of processor resource that is used. This information is displayed only for the WPARs with enforced processor resource limit.
- Disk
-
Provides information about 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 is 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 the command execution.
If you specify the -I flag, an I/O oriented view is presented with the following column changes:
- kthr
- The
pcolumn is displayed in addition to therandbcolumns.p- Indicates the average number of threads waiting for I/O messages from the raw devices. The 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
wcolumn is also displayed along with ther,b, andpcolumns. w- Indicates the number of threads per second of time that are waiting for the file system direct
I/O event to occur. The file system direct I/O events are of 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
- A new
fiandfocolumns are displayed instead of thereandcycolumns.fi- Indicates the file page-ins per second.
fo- Indicates the file page-outs per second.
If you specify the -c flag, an Active Memory Expansion view is presented with the following column changes:
- memory
- The columns
csz,cfr, anddxmare displayed in addition to columnsavmandfre.csz- Indicates the current compressed pool size, in 4 KB page units.
cfr- Indicates the free pages available in a compressed pool, in 4 KB page units.
dxm- Indicates a deficit in expanded Memory Size, in 4 KB page units.
- page
- New columns
ciandcoare displayed instead of thereandcycolumns.ci- Indicates the number of page-ins per second from a compressed pool.
co- Indicted the number of page-outs per second to a compressed pool.
If there is a change in system configuration that effects the output of the vmstat command while the vmstat command is running, the vmstat command prints a warning message about the configuration change. The vmstat command continues to display the output after printing the information about the updated system configuration and the header.
large-page section
is displayed with the following columns: alp- Indicates the number of large pages that are in use.
flp- Indicates the number of large pages that are on the large page freelist.
avmfrerefifopipocicofrsrcy
- The -I flag affects the display of the
re,fi,fo, andcyoptions. - The -c flag affects the display of the
re,ci,co, andcyoptions. - If there is no resource control, then the
avmandfreoptions are system-wide. Therefore, if the -@ option is set, both theavmandfreoptions are marked with the at sign (@).
psz column and followed by an
siz column.psz- Indicates the page size (for example, 4 KB, 64 KB).
siz- Indicates the number of frames of the specified page size that exist on the system.
pgsz- Indicates the page size (for example, 4 KBB, 64 KBB).
Memory- Indicates the memory statistics for the specified page sizes.
siz- Indicates the number of frames of the specified page size that exist on the system.
avm- Indicates the active virtual pages applicable to the specified page size.
fre- Indicates the 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, andcoare also applicable to this report.
Flags
| Item | Description |
|---|---|
| -@ wparname | Reports the Virtual Memory activity of a workload partition:
|
| -c | Displays the memory compression statistics with the new columns in the output
as, 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 you enable the Active
Memory Expansion.
|
| -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 if these flags are specified with the
-i flag.
|
| -I | Displays the I/O oriented view with the new columns of output, p under the
heading kthr, and columns fi and fo under the
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. |
| -L level | Displays the soft page promotion statistics. Note: You can only use
-v flag with the -L flag. Do not use other flags with
-L flag.
|
| -p pagesize | Appends the VMM statistics for the specified page size to the regular vmstat command output. |
| -P pagesize | Displays only the VMM statistics, which are relevant for the specified page size. |
| -s | Writes the contents of the sum structure to the standard output, which contains an absolute
count of paging events since system initialization. You can specify the -s flag
only with the -v flag. These events are described as follows:
|
| -s |
|
| -s |
When used with the -p pagesize flag, the -s flag 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, 4 KB pages). The following details are not displayed in this page size-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 the vmstat command.
The time-stamp is displayed in the HH:MM:SS format. Note: A timestamp is not
printed if -f, -s, or -i flags are
specified.
|
| -v | Writes various statistics that are maintained by the Virtual Memory Manager to the standard
output. The -v flag can be used only with the -s,
-L, and -h flags. If you specify the -v flag, the following statistics are displayed:
|
| -v (continued) |
If you specify the -h flag with the -v flag, the following additional metrics are displayed:
Notes:
If you specify the -c flag 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 by 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 command 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 by using the -c flag.
Examples
- To display a summary of the statistics since boot, enter the following command:
vmstat - To display five summaries at an interval of 2 seconds, enter the following command:
vmstat 2 5 - To display a summary of the statistics since boot that includes 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 the output of the vmstat
command, 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
alpandflpcolumns at an interval of 8 seconds, 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 ALLvmstat -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 ALLvmstat -P all - To display a summary of the statistics for all the workload partitions after boot, enter the following
command:
vmstat -@ ALL - To display all the VMM statistics available for all 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 -s
flag (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 -v
flag (in an LPAR with Active Memory Expansion
enabled), enter the following command:
vmstat -v -c - To display the soft page promotion statistics, enter the following
command:
vmstat -L 1
Files
| Item | Description |
|---|---|
| /usr/bin/vmstat | Contains the vmstat command. |