swap command
How to use swap
#> swap
blocks : 512 bytes block
free : 512 bytes block
#> swap -s
How much swap space is available
Example of ps
#> swap -l
swapfile
dev swaplo
blocks free
/dev/dsk/c0t3d0s1 32,25 8
156232 95200
#> swap -s
total: 33092k bytes allocated + 9104k
reserved = 42196k used, 53172k available
vmstat -S command
How to use vmstat -S
#> vmstat -S 5
po : kbytes paged out
pi : kbytes paged in
si : number of pages swapped in per second
so : number of whole processes swapped out
How to read vmstat -S output
¢º po = 0 : no paging occuring
Note 1. check "proc r" field
r > 1 : indicative of processor speed
r > 2 - 4 : adding more CPU
Note 2. check "proc b" field
If this column has values, run "iostat" to tune the disk I/O.
¢º po > 0 : not sufficient RAM for the application
Consult the application vendor regarding the memory requirements
¢º pi rate is NOT important
ÁÖÀÇ : ¸Þ¸ð¸®¿Í µð½ºÅ©ÀÇ ¾×¼¼½º ½Ã°£À» ±¸º°ÇÏ¿©¾ß ÇÑ´Ù.
Example of vmstat -S
#> vmstat -S 5
procs
memory page
disk
faults cpu
r b w swap free si so pi
po fr de sr f0 s0 s1 s2 in sy cs us sy id
0 0 0 53036 2848 0 0 15
8 19 0 11 0 0 0 0 52 37 92 4 3
93
0 0 0 53140 6328 0 1 5 0 0 0 0
0 0 0 0 10 21 30 1 1 98
0 0 0 53140 6328
0 0 0 0 0 0 0 0 0 0
0 31 26 62 0 1 99
sar -g command
How to use sar -g
#> sar -g 5 20
pgout/s : The average number of page-out requests per second
<= A good indication of memory performance
pgfree/s : The average number of pages per second that were added to the free list
pgscan/s : The average number of pages that needed to be scanned in order to find more memory
How to read sar data
¢º consistently pgout = 0 : NO memory problem
¢º several interval pgout > 0 : System perfomance is suffering
¢º pgfree and pgscan should be small (less than 5)
Example of sar -g
#> sar -g 5 20
SunOS
hostname 5.5.1 Generic_103640-12 sun4u 11/12/98
16:59:36 pgout/s ppgout/s
pgfree/s pgscan/s %ufs_ipf
16:59:41 1.39
5.78 23.90 79.88
0.00
16:59:46 1.60
113.77 27.74 253.69
0.00
16:59:51 0.80
2.00 13.80 81.40
0.00
16:59:56 0.20
0.20 0.20
0.00 0.00
Memory Solutions
1st. Two Memory Problem
=> The system spend a lot of time paging and/or swapping.
=> Run out of SWAP space
2nd. Check SZ field from "ps -efl"
3rd. For 1st. problem;
=> Adding physical memory until no paging and swapping.