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 ]
Note: The wparname option and the -i flag must not be used together in the workload partitions.

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

The system configuration row has the following values:
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:
  1. The system WPAR name indicates the system-wide statistics and the global WPAR name indicates that the statistics belong to Global only.
  2. 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.
  3. 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.
  4. 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 p column is displayed in addition to the r and b columns.
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 w column is also displayed along with the r, b, and p columns.

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 fi and fo columns are displayed instead of the re and cy columns.
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, and dxm are displayed in addition to columns avm and fre.
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 ci and co are displayed instead of the re and cy columns.
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.

If you specify a -l flag, an additional 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.
If you specify the -p flag, additional lines of VMM statistics are displayed for the specified page sizes. If you specify -I and -t flags, the -p flag produces an additional line for the specified page size. This additional line contains the following VMM statistics relevant to the specified page size:
  • avm
  • fre
  • re
  • fi
  • fo
  • pi
  • po
  • ci
  • co
  • fr
  • sr
  • cy
Notes:
  • The -I flag affects the display of the re, fi, fo, and cy options.
  • The -c flag affects the display of the re, ci, co, and cy options.
  • If there is no resource control, then the avm and fre options are system-wide. Therefore, if the -@ option is set, both the avm and fre options are marked with the at sign (@).
These VMM statistics are preceded by a 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.
If you specify the -s flag, the -p flag produces a separate stanza of output that contains only the statistics relevant to the specified page size. This additional stanza is preceded by a page size header.
The -P option generates the following report for the specified page size:
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, and co are also applicable to this report.

Flags

Note: If you specify either -f or -s flag on the command line, the system accepts the -f or -s flag and ignores the other flags. If you specify both the -f and -s flags on the command line, the system accepts only the first flag and ignores the second flag.
Item Description
-@ wparname Reports the Virtual Memory activity of a workload partition:
  • The -@ ALL option indicates that the report pertains to the system and global environment, in addition to all the workload partitions in the system.
    Note: The values that are system-wide statistics are marked with dash sign (-) against the WPAR section.
  • The -@ wparname flag indicates that the activity is only for that workload partition. In a workload partition, if you specify the -@ flag, system-wide statistics and workload partition statistics are displayed. The system-wide statistics are marked with the at sign (@).
    Note: Do not use the -@ flag with any combination of the -i flag.
-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:
address translation faults
Incremented for each occurrence of an address translation page fault. I/O might not be required to resolve the page fault. Storage protection page faults (lock misses) are not included in this count.
backtracks
Incremented for each page fault that occurs while resolving a previous page fault. Resolve the new page fault first and then initial page faults can be backtracked.
CPU context switches
Incremented for each processor context switch (dispatch of a new process).
decrementer interrupts
Incremented on each decrementer interrupt.
device interrupts
Incremented on each hardware interrupt.
executable-filled page faults
Incremented for each instruction page fault.
extend XPT waits
Incremented each time that a process is waited by VMM due to a commit in progress for the segments accessed.
free frame waits
Incremented each time that a process requests a page frame. The free list is empty, and the process is forced to wait while the free list is replenished.
iodones
Incremented at the completion of each VMM I/O request.
mpc send interrupts
Incremented each time a multipath channel (mpc) sends an interrupt.
mpc receive interrupts
Incremented each time that a mpc receives an interrupt.
page-ins
Incremented for each page read in by the virtual memory manager. The count is incremented for page-ins from page space and file space. Along with the page-out statistic, this value represents the total amount of real I/O initiated by the virtual memory manager.
page-outs
Incremented for each page that is written by the virtual memory manager. The count is incremented for page-outs to page space and for page-outs to file space. Along with the page-in statistic, this statistic represents the total amount of real I/O initiated by the virtual memory manager.
paging space page-ins
Incremented for VMM initiated page-ins from paging space only.
paging space page-outs
Incremented for VMM initiated page-outs to paging space only.
pages examined by the clock
VMM uses a clock-algorithm to implement a pseudo least recently used (LRU) page replacement scheme. Pages are aged by being examined by the clock. This count is incremented for each page examined by the clock.
pages freed by the clock
Incremented for each page the clock-algorithm selects to free from real memory.
pending I/O waits
Incremented each time that a process is waited by VMM for a page-in I/O to complete.
-s
phantom interrupts
Incremented on each phantom interrupt.
revolutions of the clock hand
Incremented for each VMM clock revolution (that is after each complete scan of memory).
start I/Os
Incremented for each read or write I/O request that is initiated by VMM.
syscalls
Incremented for each system call.
total reclaims
Incremented when an address translation fault is satisfied without initiating a new I/O request. This event occurs in the following conditions:
  • If the page is previously requested by VMM, but the I/O is not yet complete.
  • If the page was pre-fetched by the read-ahead algorithm of VMM, but was hidden from the faulting segment
  • If the page was put on the free list and is not yet reused.
traps
Indicates that the event is not maintained by the operating system.
zero-filled page faults
Incremented if the page fault is to working storage and can be satisfied by assigning a frame and zero-filling it.
If you specify the -c flag along with the -s flag, the following additional metrics are displayed:
compressed pool page ins
Indicted the number of page-ins from the Compressed Pool since system boot.
compressed pool page outs
Indicates the number of page-outs to the Compressed Pool since system boot.
-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:

  • Processor context switches
  • Device interrupts
  • Software interrupts
  • Decrementer interrupts
  • MPC-sent interrupts
  • MPC-received interrupts
  • Phantom interrupts
  • Traps
  • Syscalls
Notes:
  1. If you specify -s flag with the -@ ALL flag, the system-wide statistics are repeated in the workload partition section.
  2. If you specify -s flag with the -@ wparname flag, all metrics are reported and the system-wide statistics are marked with the at sign (@).
  3. If you specify -s flag with the -l flag, the vmstat command displays the following metric:
    large-page hi water count
    Specifies the maximum value of the large-page in use count.
-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:
  • us
  • sy
  • id
  • wa
  • pc
  • ec
Notes:
  1. Do not specify the -S flag with the -f, -s, -i, -v, or -p flags.
  2. When the -S flag is specified, the us, sy, id, and wa statistics change. By default, the us, sy, id, and wa statistics are relative to the processor consumption of WPAR. When the -S flag is specified with a value of power that is not equal to zero, these statistics are relative to system-wide processor consumption.
  3. The value of power for -S flag is in the range 0-3.
-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:

compressed percentage
Indicates the percentage of memory that is used by compressed pages.
client filesystem I/Os blocked with no fsbuf
Indicates the number of client file system I/O requests blocked because no fsbuf was available. Network File System (NFS) and Veritas (VxFS) are client file systems. Fsbuf are pinned memory buffers that are used to hold I/O requests in the file system layer.
client pages
Indicates the number of client pages.
compressed pages
Indicates the number of compressed memory pages.
external pager filesystem I/Os blocked with no fsbuf
Indicates the number of external pager client file system I/O requests blocked because no fsbuf was available. JFS2 is an external pager client file system. Fsbuf are pinned memory buffers that are used to hold I/O requests in the file system layer.
file pages
Indicates the number of 4 KBB pages that are used by the file cache.
free pages
Indicates the number of free 4 KBB pages.
filesystem I/Os blocked with no fsbuf
Indicates the number of file system I/O requests blocked because no fsbuf was available. Fsbuf are pinned memory buffers that are used to hold I/O requests in the file system layer.
lruable pages
Indicates the number of 4 KBB pages that are considered for replacement. This number excludes the pages that are used for VMM internal pages, and the pages that are used for the pinned part of the kernel text.
maxclient percentage
Indicates the tuning parameter (managed by using vmo) that specifies the maximum percentage of memory, which can be used for client pages.
maxperm percentage
Indicates the tuning parameter in the percentage of real memory that is managed by using vmo.
maxpin percentage
Indicates the tuning parameter (managed by using vmo) that specifies the percentage of real memory that can be pinned.
memory pages
Indicted the size of real memory in a number of 4 KBB pages.
memory pools
Indicates the tuning parameter that specifies the number of memory pools that are managed by using vmo.
minperm percentage
Indicates the tuning parameter in the percentage of real memory that is managed by using vmo.
numclient percentage
Indicates the percentage of memory that is occupied by client pages.
-v (continued)
numperm percentage
Indicates the percentage of lruable memory that is used by the file cache.
paging space I/Os blocked with no psbuf
Indicates the number of paging space I/O requests that are blocked because the psbuf space is not available. The psbufs space is pinned memory buffers that are used to hold I/O requests at the virtual memory manager layer.
pending disk I/Os blocked with no pbuf
Indicates the number of pending disk I/O requests that are blocked because no pbuf was available. The pbuf are pinned memory buffers that are used to hold I/O requests at the logical volume manager layer.
pinned pages
Indicates the number of pinned 4 KBB pages.
Note: When the kernel locking feature (vmm_klock_mode parameter) is enabled, the pinned pages include the kernel locking (klocked) pages. For more information about the kernel locking feature, enter the following command:
vmo -h vmm_klock_mode
remote page-outs scheduled
Indicates the number of page-outs that are scheduled for client file systems.

If you specify the -h flag with the -v flag, the following additional metrics are displayed:

Time resolving virtualized partition memory page faults
Indicates the total time that the virtual partition is blocked to wait for the resolution of its memory page fault. The time is measured in seconds, with millisecond granularity.
Virtualized partition memory page faults
Indicates the total number of virtual partition memory page faults that are recorded for the virtualized partition.
Number of 4 KB page frames loaned
Indicates the number of 4 KB pages of the memory of the partition that is loaned to the hypervisor.
Percentage of partition memory loaned
Indicates the percentage of the memory of the partition that is loaned to the hypervisor.
Notes:
  1. When the -v flag is used with the -@ ALL flag, the system-wide statistics are not repeated in the workload partition section.
  2. When the -s flag is used with the -@ wparname flag, all metrics are reported and the system-wide statistics are marked with the at sign (@).
If you specify the -c flag along with the -v flag, the following additional metrics are displayed:
Compressed Pool Size
Indicates the size of Compressed Pool, in 4 KB page unit.
percentage of true memory that is used for compressed pool
Indicates the percentage of unexpanded memory that is used for compressed pool.
free pages in compressed pool (4 KB pages)
Indicates the number of free pages in a compressed pool, in a 4 KB page unit.
target memory expansion factor
Indicates the target memory expansion factor that is configured for the LPAR.
achieved memory expansion factor
Indicates the Current memory expansion factor that is achieved.
-h Displays the hypv-page section that includes the hypervisor page information. The hypv-page section contains the following metrics:
hpi
Indicates the number of hypervisor page-in per second.
hpit
Indicates the average time that is spent in milliseconds per hypervisor page-in.
pmem
Indicates the amount of physical memory that backs the logical memory of partitions. The value is measured in gigabytes.

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:

Time resolving virtualized partition memory page faults
Indicates the total time that the virtual partition is blocked to wait for the resolution of its memory page fault. The time is measured in seconds, with millisecond granularity.
Virtualized partition memory page faults
Indicates the total number of virtual partition memory page faults that are recorded for the virtualized partition.
Number of 4 KBB page frames loaned
Indicates the number of the 4 KBB pages of the memory that is loaned to the hypervisor in the partition.
Percentage of partition memory loaned
Indicates that the percentage of the memory loaned to the hypervisor in the partition.
-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.
Notes:
  1. 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.
  2. The AME_MEMVIEW environment variable has no impact on memory statistics reported by using the -c flag.

Examples

  1. To display a summary of the statistics since boot, enter the following command:
    vmstat
  2. To display five summaries at an interval of 2 seconds, enter the following command:
    vmstat 2 5
  3. 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
  4. To display fork statistics, enter the following command:
    vmstat -f
  5. To display the count of various events, enter the following command:
    vmstat -s
  6. To display time-stamp next to each column of the output of the vmstat command, enter the following command:
    vmstat -t
  7. To display the I/O oriented view with an alternative set of columns, enter the following command:
    vmstat -I
  8. To display all the VMM statistics available, enter the following command:
    vmstat -vs
  9. To display the large-page section with the alp and flp columns at an interval of 8 seconds, enter the following command:
    vmstat -l 8
  10. To display the VMM statistics specific to a particular page size (in the example, 4 KB), enter the following command:
    vmstat -p 4K
  11. To display the VMM statistics for all page sizes that are supported on the system, enter the following command:
    vmstat -p ALL
    Or enter the following command:
    vmstat -p all
  12. To display only the VMM statistics for a particular page size (in this example, 4 KB), enter the following command:
    vmstat -P 4K
  13. To display only the per-page breakdown of VMM statistics for all supported page sizes, enter the following command:
    vmstat -P ALL
    or enter the following command:
    vmstat -P all
  14. To display a summary of the statistics for all the workload partitions after boot, enter the following command:
    vmstat -@ ALL
  15. To display all the VMM statistics available for all the workload partitions, enter the following command:
    vmstat -vs -@ ALL
  16. To display both WPAR and system-wide VMM statistics from a workload partition, enter the following command:
    vmstat -@
  17. To multiply the processor values with 10 and display the results, enter the following command:
    vmstat -S 1
  18. To display the statistics for the hypervisor page, enter the following command:
    vmstat -h
  19. To display the information about pages that are loaned to the hypervisor, enter the following command:
    vmstat -vh
  20. To display memory compression statistics (in an LPAR with Active Memory Expansion enabled), enter the following command:
    vmstat -c
  21. 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
  22. 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
  23. 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
  24. To display the soft page promotion statistics, enter the following command:
    vmstat -L 1

Files

Item Description
/usr/bin/vmstat Contains the vmstat command.