1834149 Members
2456 Online
110064 Solutions
New Discussion

proper settings for swap

 
SOLVED
Go to solution
Randy_9
Regular Advisor

proper settings for swap

Question:
I have 2GB of RAM and a 4 GB swap device,
the kernel setting for maxdsiz and maxswapchunks are:
# sysdef | grep -i maxdsiz
maxdsiz 503866 - 0-503866 Pages -
maxdsiz_64bit 524288 - 1024-1073479679 Pages -
# sysdef | grep -i maxswapchunks
maxswapchunks 2048 - 1-16384 -

Are these set to the optimal level to take advantage of the RAM and swap, do you
see a problem?

Thanks,

Randy
4 REPLIES 4
Patrick Wallek
Honored Contributor
Solution

Re: proper settings for swap

maxswapchunks controls the MAXIMUM AMOUNT of swap you can have configured on your system. So if you have 4GB configured and it is active and available (ie. No errors when the system boots about not being able to active swap) then that parameter is good. It controls nothing else with regards to usage of swap space or RAM.
Maxswapchunks info -
http://docs.hp.com/hpux/onlinedocs/939/KCParms/KCparam.MaxSwapChunks.html

maxdsiz and maxdsiz_64 specify the maximum data segment size, in bytes, for an executing process. So that is one of the controls to keep a process from using too much RAM. See here for more info on maxdsiz* parameters - http://docs.hp.com/hpux/onlinedocs/939/KCParms/KCparam.MaxDsiz.html

You can also look here for info on all configurable kernel parms -
http://docs.hp.com/hpux/onlinedocs/939/KCParms/KCparams.OverviewAll.html

Is there some problem you are having that is leading to these questions?
Randy_9
Regular Advisor

Re: proper settings for swap

Patrick,

Some developers were running into
problems with swap ( they weren't
too detailed ) so I thought I would
double the current settings.

Thank you,

Randy
Kevin Wright
Honored Contributor

Re: proper settings for swap

There is no reason to double the maxswapchunks parameter unless you plan on adding more swap. This simply determines how much swap is allowed to be configured on your system. I usually set it to the max when I first build a server and be done with it.

check your swap usage with swapinfo -tam.
Steven E. Protter
Exalted Contributor

Re: proper settings for swap

When developers get errors and trace them back to swap or lack of memory, this is were we start:

swapminfo -tam

This shows if were are really using all or most of our swap.

Now: If you have high utilization and swap is already twice RAM don't add any more swap. You'll just slow your system down.

In that scenario you need memory.

If however you need general swap guidelines:

I'm a member of the A. Clay Stephenson school of swap.
I set one swap area, as small as possible as primary, sometimes as small as half system ram. I then set a secondary swap area to cover the rest.

This gets me very fast performance during low and medium system loads.

To pick the overall number: between 1.5 and 2.0 times RAM. The more RAM you have the less you need to be in the 2.0 multiple neighborhood.

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