1832832 Members
2893 Online
110047 Solutions
New Discussion

Swap space utilization

 
SOLVED
Go to solution
shajes.p
Occasional Contributor

Swap space utilization

Hi all,
I am facing problems with the swap space utilization in our L-class server . The reserved space has increased after upgraded the physical mem from 4 GB to 8GB.
I am copyig the swapinfo output here.
Mb Mb Mb PCT START/ Mb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 4096 322 3774 8% 0 - 1 /dev/vg00/lvol2
dev 4096 321 3775 8% 0 - 1 /dev/vg00/lvol10
dev 4096 321 3775 8% 0 - 1 /dev/vg00/lvol11
dev 4096 324 3772 8% 0 - 1 /dev/vg00/lvol12
dev 4096 0 4096 0% 0 - 1 /dev/vg01/swap5
reserve - 14990 -14990
total 20480 16278 4202 79% - 0 -

How can i reduce the reservation?
Thanks in advance .
spv
6 REPLIES 6
G. Vrijhoeven
Honored Contributor

Re: Swap space utilization

Hi,

Why would you like to reduce the reservation.
If a process starts it reserves swap space just in case it needs to swap out. It does not use it. If you like to reduce it the only thing you can do is stop processes, or reduce the memory the consume.

Gideon
Stefan Farrelly
Honored Contributor

Re: Swap space utilization

Only way to reduce reserve amount is to remove some swap areas! Reserve only shows space reserved (not used!) for user processes - it increases as you add more swap areas - there is no way you would want to reduce this even if you could.
Im from Palmerston North, New Zealand, but somehow ended up in London...
Steven E. Protter
Exalted Contributor
Solution

Re: Swap space utilization

Too many swap areas.

The old rule about swap being twice ram does not necessarily apply when you push that far into the memory stratosphere.

If this is a common swap lode factor, you could easily do without the last one or two areas.

Also note they are all the same priority. You can get better swap performance by making one of them priority 0 and assigning lower priority(higher numbers) to the rest.

This will reduce disk band width use during light swaping circumstances.

The A Clay. Stephenson suggestion in this regard is the first swap area is small, the minimum, whichis half ram, priority zero. Then maybe one or two more adding up to perhaps 1.0 to 1.5 times ram each at a higher number, therefore lower number.

Prior to makding changes, you may wish to measure swap utilization over time.

Try the script I'm attaching.

Its an older version, you need to break the top command out to its own line, but it does work rather nicely.

let me know if want the latest version its at work. I'm, not.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
shajes.p
Occasional Contributor

Re: Swap space utilization

Dear stevan,

The last swap dev was added one hour back as the swap utilization was 100%.
The same system was working with 4 GB and never it reached more than 90% swap utilization. The swap space available of 16GB was available that time too. Now after increasing the RAM to 8GB y 100% of swap is getting used now ?

thanks,
spv
Alex Ostapenko
Advisor

Re: Swap space utilization

If you have 16GB of swap space for 4GB of physical memory and 90% of the 16GB is reserved, you have a considerable overcommitment of physical memory that may be okay or may be resulting in memory pressure.

It appears from your output of "swapinfo" that the kernel parameter "swapmem_on" is set to zero (disabled). You should probably have it set to 1 (enabled). This will allow the swap space to increase a little automatically with your increase of physical memory.

I do not know what your kernel parameter "dbc_max_pct" is set to, but HP's default is 50%. That means with 4GB memory, 2GB was for DBC (dynamic buffer cache). If you doubled memory to 8GB, now 4GB is for DBC leaving you only 4GB of usable memory. You probably want to adjust "dbc_max_pct" down to 6 (6% of 8GB is around 500MB).

Also, it would be help to us to see a couple of lines from the "vmstat" command during a busy time, say "vmstat 5" to see how the system is behaving with its overcommitment of physical memory, e.g., active virtual memory, page-ins/outs, scan rate.

The available/usable swap space is limited by the kernel parameter "maxswapchunks" and "swchunks", so it would be good to know what those parameters are now. If swchunk is the default 2048, then maxswapchunks must be at least 10240 to allow use of all 20GB of your swap space; if it's less, you don't have full use of your swap devices.

With regards to priority of swap devices, don't worry about that yet until we determine what the paging activity is (from the vmstat command above).

Send your info, and I'll respond again:
1. status of "swapmem_on" kernel parm
2. size of "dbc_max_pct" kernel parm
3. output from "vmstat 5" command during a busy time
4. size of "maxswapchunks" and "swchunks" kernel parms
5. output from "swapinfo -mta" command

Thanks!

=:-) Alex