You are on page 1of 8

vmstat Command Purpose Reports virtual memory statistics.

Syntax vmstat [ -f ] [ -i ] [ -s ] [ -I ] [ -t ] [ -v ] [ -w] [ -l ] [ { -p | -P } page size | ALL ] ALL ] [ PhysicalVolume ... ] [ Interval [ Count ] ] Description The vmstat command reports statistics about kernel threads, virtual memory, disk s, traps and pocessor activity. Reports generated by the vmstat command can be u sed to balance system load activity. These system-wide statistics (among all pro cessors) 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 the vmstat command is invoked without flags, the report contains a summary of the virtual memory activity since system startup. If the -f flag is specified, the vmstat command reports the number of forks since system startup. The Physica lVolume parameter specifies the name of the physical volume. The Interval parameter specifies the amount of time in seconds between each repo rt. If the Interval parameter is not specified, the vmstat command generates a s ingle report that contains statistics for the time since system startup and then exits. The Count parameter can only be specified with the Interval parameter. I f the Count parameter is specified, its value determines the number of reports g enerated and the number of seconds apart. If the Interval parameter is specified without the Count parameter, reports are continuously generated. A Count parame ter of 0 is not allowed. AIX 4.3.3 and later contain enhancements to the method used to compute the perce ntage 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 circu mstances, 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 i nterrupt on each processor (100 times a second per processor), a determination i s made as to which of the four categories (usr/sys/wio/idle) to place the last 1 0 ms of time. If the processor was busy in usr mode at the time of the clock int errupt, then usr gets the clock tick added into its category. If the processor w as 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 inc remented. 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 proc essors 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 per cent wio time regardless of the number of processors it has. The wio time is rep orted by the commands sar (%wio), vmstat (wa) and iostat (% iowait). The kernel maintains statistics for kernel threads, paging, and interrupt activi ty, which the vmstat command accesses through the use of the the perfstat kernel extension. The disk input/output statistics are maintained by device drivers. F or disks, the average transfer rate is determined by using the active time and n umber of transfers information. The percent active time is computed from the amo unt of time the drive is busy during the report.

Beginning with AIX 5.3, the vmstat command reports the number of physical proces sors consumed (pc), and the percentage of entitlement consumed (ec), in Micro-Pa rtitioning environments. These metrics will only be displayed on Micro-Partition ing environments. Reports generated by the vmstat command contains the following column headings a nd their description: kthr: information about kernel thread states. r Average number of runnable kernel threads over the sampling interval. Ru nnable refers to threads that are ready but waiting to run and to those threads already running. b Average number of kernel threads placed in the VMM wait queue (awaiting resource, awaiting input/output) over the sampling interval. Memory: information about the usage of virtual and real memory. Virtual pages ar e considered active if they have been accessed. A page is 4096 bytes. 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 i s 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. re pi po fr sr cy Faults: Pager input/output list. Pages paged in from paging space. Pages paged out to paging space. Pages freed (page replacement). Pages scanned by page-replacement algorithm. Clock cycles by page-replacement algorithm. trap and interrupt rate averages per second over the sampling interval. interrupts. calls. thread context switches. of percentage usage of processor time.

in Device sy System cs Kernel Cpu: breakdown

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 part ition is running with shared processor. Because the time base over which this da ta is computed can vary, the entitled capacity percentage can sometimes exceed 1 00%. This excess is noticeable only with small sampling intervals. Disk: Provides the number of transfers per second to the specified physical volu mes that occurred in the sample interval. The PhysicalVolume parameter can be us ed to specify one to four names. Transfer statistics are given for each specifie d drive in the order specified. This count represents requests to the physical d evice. It does not imply an amount of data that was read or written. Several log ical requests can be combined into one physical request. If the PhysicalVolume p arameter is used, the physical volume names are printed at the beginning of comm and execution.

If the -I flag is specified, an I/O oriented view is presented with the followin g column changes. kthr The column p will also be displayed besides columns r and b. p Number of threads waiting on I/O to raw devices per second. page New columns fi and fo will be displayed instead of re and cy columns. fi File page-ins per second. fo File page-outs per second. If, while the vmstat command is running, there is a change in system configurati on that will affect the output, vmstat prints a warning message about the config uration change. It then continues the output, after printing the updated system configuration information and the header. If the -l flag is specified, an additional "large-page" section is displayed wit h the following columns: alp Indicates the number of large pages currently in use. flp Indicates the number of large pages on the large page freelist. If the -p option is specified, additional lines of VMM statistics are displayed for the specified page sizes. With -I and -t options, the -p option produces an additional line for the specified page size. This line contains the following VM M statistics relevant to the specified page size: avm fre re fi fo pi po fr sr cy Note: The disply of the re, fi, fo, and cy options are affected by the -I option. These VMM statistics are preceded by a psz column and followed by an siz column. The description of these two columns follows: psz Page size (for example, 4K, 64K). siz Number of frames of the specified page size that exist on the system. With the -s option, the -p option produces a separate stanza of output that cont ains only the statistics relevant to the specified page size. This additional st anza is preceded by a page size header. The -P option produces the following report for the specified page size: pgsz Indicates the page size (for example, 4K, 64K). 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 si ze. The page related columns re, pi, po, fr, sr, cy, fi, and fo are also applica ble to this report. Flags Note: If the -f (or -s) flag is entered on the command line, then the system will only accept the -f (or -s) flag and will ignore other flags. If both -f and -s flags are specified, the system will accept only the first flag and ignore the second flag. -f Reports the number of forks since system startup. -i Displays the number of interrupts taken by each device since system star tup. Note: The -I, -t, -w, and -l flags are ignored when they are specified with the -i fla g. -I Displays I/O oriented view with the new columns of output, p under headi ng kthr,and columns fi and fo under heading page instead of the columns re and c y 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 re gular vmstat output. -P pagesize Displays only the VMM statistics which are relevant for the spec ified page size. -s Writes to standard output the contents of the sum structure, which conta ins 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: address translation faults Incremented for each occurrence of an address translation page fault. I/O may or may not be required to resolve the page fault. Storage protection page faults ( lock misses) are not included in this count. page ins Incremented for each page read in by the virtual memory manager. The count is in cremented for page ins from page space and file space. Along with the page out s tatistic, this represents the total amount of real I/O initiated by the virtual memory manager. page outs Incremented for each page written out by the virtual memory manager. The count i s incremented for page outs to page space and for page outs to file space. Along with the page in statistic, this represents the total amount of real I/O initia ted 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. total reclaims Incremented when an address translation fault can be satisfied without initiatin g a new I/O request. This can occur if the page has been previously requested by VMM, but the I/O has not yet completed; or if the page was pre-fetched by VMM's read-ahead algorithm, but was hidden from the faulting segment; or if the page has been put on the free list and has not yet been reused. zero-filled page faults Incremented if the page fault is to working storage and can be satisfied by assi gning a frame and zero-filling it. executable-filled page faults

Incremented for each instruction page fault. 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. revolutions of the clock hand Incremented for each VMM clock revolution (that is, after each complete scan of memory). pages freed by the clock Incremented for each page the clock algorithm selects to free from real memory. backtracks Incremented for each page fault that occurs while resolving a previous page faul t. (The new page fault must be resolved first and then initial page faults can b e backtracked.) free frame waits Incremented each time a process requests a page frame, the free list is empty, a nd the process is forced to wait while the free list is replenished. extend XPT waits Incremented each time a process is waited by VMM due to a commit in progress for the segment being accessed. pending I/O waits Incremented each time a process is waited by VMM for a page-in I/O to complete. start I/Os Incremented for each read or write I/O request initiated by VMM. iodones Incremented at the completion of each VMM I/O request. CPU context switches Incremented for each processor context switch (dispatch of a new process). device interrupts Incremented on each hardware interrupt. software interrupts Incremented on each software interrupt. A software interrupt is a machine instru ction similar to a hardware interrupt that saves some state and branches to a se rvice routine. System calls are implemented with software interrupt instructions that branch to the system call handler routine. decrementer interrupts Incremented on each decrementer interrupt. mpc send interrupts Incremented on each mpc send interrupt mpc receive interrupts Incremented on each mpc receive interrupt phantom interrupts Incremented on each phantom interrupt traps Not maintained by the operating system. syscalls Incremented for each system call. Notes: When used with the -p pagesize option, the -s option appends the sum structure f or the specified page size to the system-wide sum structure. This additional sta nza is preceded by a page size header (for example, 4K pages). The following det ails are not be displayed in this pagesize-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 When the -s flag is used with the -l flag, the vmstat command displays the follo wing metric: large-page hi water count Specifies the maximum value of the large-page inuse count. -t Prints the time-stamp next to each line of output of vmstat. The time-st amp 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 M emory Manager. The -v flag can only be used with the -s flag. memory pages Size of real memory in number of 4 KB pages. lruable pages Number of 4 KB pages considered for replacement. This number excludes the pages used for VMM internal pages, and the pages used for the pinned part of the kerne l text. free pages Number of free 4 KB pages. memory pools Tuning parameter (managed using vmo) specifying the number of memory pools. pinned pages Number of pinned 4 KB pages. maxpin percentage Tuning parameter (managed using vmo) specifying the percentage of real memory wh ich can be pinned. minperm percentage Tuning parameter (managed using vmo) in percentage of real memory. This specifie s the point below which file pages are protected from the re-page algorithm. maxperm percentage Tuning parameter (managed using vmo) in percentage of real memory. This specifie s the point above which the page stealing algorithm steals only file pages. numperm percentage Percentage of memory currently used by the file cache. file pages Number of 4 KB pages currently used by the file cache. compressed percentage Percentage of memory used by compressed pages. compressed pages Number of compressed memory pages. numclient percentage Percentage of memory occupied by client pages. maxclient percentage Tuning parameter (managed using vmo) specifying the maximum percentage of memory which can be used for client pages. client pages Number of client pages. remote pageouts scheduled Number of pageouts scheduled for client filesystems. pending disk I/Os blocked with no pbuf Number of pending disk I/O requests blocked because no pbuf was available. Pbufs are pinned memory buffers used to hold I/O requests at the logical volume manag er layer. paging space I/Os blocked with no psbuf Number of paging space I/O requests blocked because no psbuf was available. Psbu fs are pinned memory buffers used to hold I/O requests at the virtual memory man ager layer. -v (Statistics displayed by -v, continued):

filesystem I/Os blocked with no fsbuf Number of filesystem I/O requests blocked because no fsbuf was available. Fsbuf are pinned memory buffers used to hold I/O requests in the filesystem layer. client filesystem I/Os blocked with no fsbuf Number of client filesystem I/O requests blocked because no fsbuf was available. NFS (Network File System) and VxFS (Veritas) are client filesystems. Fsbuf are pinned memory buffers used to hold I/O requests in the filesystem layer. external pager filesystem I/Os blocked with no fsbuf Number of external pager client filesystem I/O requests blocked because no fsbuf was available. JFS2 is an external pager client filesystem. Fsbuf are pinned me mory buffers used to hold I/O requests in the filesystem layer. Virtualized Partition Memory Page Faults Total number of virtual partition memory page faults recorded for the virtualize d partition. Time resolving virtualized partition memory page faults Total time (in seconds, with millisecond granularity) the virtual partition has been blocked waiting for the resolution of the virtual partition's memory page f aults. -w Display the report in wide mode. Examples To display a summary of the statistics since boot, enter: vmstat To display five summaries at 2-second intervals, enter: vmstat 2 5 To display a summary of the statistics since boot including statistics for logic al disks scdisk13 and scdisk14, enter: vmstat scdisk13 scdisk14 To display fork statistics, enter: vmstat -f To display the count of various events, enter: vmstat -s To display time-stamp next to each column of output of vmstat, enter: vmstat -t To display the I/O oriented view with an alternative set of columns, enter: vmstat -I To display all the VMM statistics available, enter: vmstat -vs To display the large-page section with the alp and flp columns at 8-second inter vals, enter: vmstat -l 8 To display the VMM statistics specific to a particular page size (in the example , 4 K), enter: vmstat -p 4 K To display the VMM statistics for all page sizes that are supported on the syste m, enter: vmstat -p ALL OR vmstat -p all To display only the VMM statistics for a particular page size (in this example, 4K), enter: vmstat -P 4K To display only the per-page breakdown of VMM statistics for all supported page sizes, enter: vmstat -P ALL OR vmstat -P all Files /usr/bin/vmstat Contains the vmstat command.

Related Information The iostat and vmo command. Memory performance in Performance management. [ Top of Page | Previous Page | Next Page | Index | Feedback ]

You might also like