How to Display Virtual Memory Statistics (vmstat)
Collect virtual memory statistics by using the vmstat command with a time interval in seconds.
$ vmstat n |
n is the interval in seconds between reports.
Example--Displaying Virtual Memory Statistics
The following example shows the vmstat display of statistics gathered at five-second intervals.
$ vmstat 5 procs memory page disk faults cpu r b w swap free re mf pi po fr de sr f0 s3 -- -- in sy cs us sy id 0 0 8 28312 668 0 9 2 0 1 0 0 0 1 0 0 10 61 82 1 2 97 0 0 3 31940 248 0 10 20 0 26 0 27 0 4 0 0 53 189 191 6 6 88 0 0 3 32080 288 3 19 49 6 26 0 15 0 9 0 0 75 415 277 6 15 79 0 0 3 32080 256 0 26 20 6 21 0 12 1 6 0 0 163 110 138 1 3 96 0 1 3 32060 256 3 45 52 28 61 0 27 5 12 0 0 195 191 223 7 11 82 0 0 3 32056 260 0 1 0 0 0 0 0 0 0 0 0 4 52 84 0 1 99 |
How to Display System Event Information (vmstat -s)
Run the vmstat -s command to show the total of various system events that have taken place since the last time the system was booted.
$ vmstat -s 0 swap ins 0 swap outs 0 pages swapped in 0 pages swapped out 392182 total address trans. faults taken 20419 page ins 923 page outs 30072 pages paged in 9194 pages paged out 65167 total reclaims 65157 reclaims from free list 0 micro (hat) faults 392182 minor (as) faults 19383 major faults 85775 copy-on-write faults 66637 zero fill page faults 46309 pages examined by the clock daemon 6 revolutions of the clock hand 15578 pages freed by the clock daemon 4398 forks 352 vforks 4267 execs 12926285 cpu context switches 109029866 device interrupts 499296 traps 22461261 system calls 778068 total name lookups (cache hits 97%) 18739 user cpu 34662 system cpu 52051435 idle cpu 25252 wait cpu |
How to Display Swapping Statistics (vmstat -S)
Run vmstat -S to show swapping statistics.
$ vmstat -S procs memory page disk faults cpu r b w swap free si so pi po fr de sr f0 s0 s6 -- in sy cs us sy id 0 0 0 200968 17936 0 0 0 0 0 0 0 0 0 0 0 109 43 24 0 0 100 |
The swapping statistics fields are described in the following table. For a description of the other fields, see Table 24-1.
Table 24-2 Output From the vmstat -S Command
Field Name | Description |
---|---|
si | Average number of LWPs that are swapped in per second |
so | Number of whole processes that are swapped out |
Note - The vmstat command truncates the output of both fields. Use the sar command to display a more accurate accounting of swap statistics.
How to Display Cache Flushing Statistics (vmstat -c)
Run the vmstat -c command to show cache flushing statistics for a virtual cache.
$ vmstat -c usr ctx rgn seg pag par 0 60714 5 134584 4486560 4718054 |
The output shows the total number of cache flushes since the last boot. The cache types are described in the following table.
Table 24-3 Output From the vmstat -c Command
Cache Name | Cache Type |
---|---|
usr | User |
ctx | Context |
rgn | Region |
seg | Segment |
pag | Page |
par | Partial-page |
How to Display Interrupts Per Device (vmstat -i)
Run the vmstat -i command to show the number of interrupts per device.
$ vmstat -i |
Example--Displaying Interrupts Per Device
The following example shows output from the vmstat -i command.
$ vmstat -i interrupt total rate -------------------------------- clock 52163269 100 esp0 2600077 4 zsc0 25341 0 zsc1 48917 0 cgsixc0 459 0 lec0 400882 0 fdc0 14 0 bppc0 0 0 audiocs0 0 0 -------------------------------- Total 55238959 105 |
Displaying Disk Utilization Information (iostat n)
Use the iostat command to report statistics about disk input and output, and produces measures of throughput, utilization, queue lengths, transaction rates, and service time. For a detailed description of this command, refer to iostat(1M).
How to Display Disk Utilization Information (iostat)
You can display disk utilization information by using the iostat command with a time interval in seconds.
$ iostat 5 tty fd0 sd3 nfs1 nfs31 cpu tin tout kps tps serv kps tps serv kps tps serv kps tps serv us sy wt id 0 1 0 0 410 3 0 29 0 0 9 3 0 47 4 2 0 94 |
The first line of output shows the statistics since the last time the system was booted. Each subsequent line shows the interval statistics. The default is to show statistics for the terminal (tty), disks (fd and sd), and CPU (cpu).
The following table describes the fields in the iostat command output.
Table 24-4 Output From the iostat n Command
Device Type | Field Name | Description |
---|---|---|
Terminal |
|
|
| tin | Number of characters in the terminal input queue |
| tout | Number of characters in the terminal output queue |
Disk |
|
|
| bps | Blocks per second |
| tps | Transactions per second |
| serv | Average service time, in milliseconds |
CPU |
|
|
| us | In user mode |
| sy | In system mode |
| wt | Waiting for I/O |
| id | Idle |