1834125 Members
2472 Online
110064 Solutions
New Discussion

Re: swap space ??

 
Not applicable

swap space ??

Dear all

Is there any restrication for swap sapce ??
which one is correct ?? from following

1. No
2. maxswapchunkx
3. between 4mb to 64GB
3 REPLIES 3
A. Clay Stephenson
Acclaimed Contributor

Re: swap space ??

Hi,

I would set 'swapmem_on' to 1.
Conventional wisdom (though not my preference) is to set swapsize to approximately 2X memory.
Set 'maxswapchunks' X 2MB >= to desired swap size. The 2MB is [swchunk (2048) X blksize (1024)]. I would actually set maxswapchunks bigger than I need so that I don't have to gen a new kernel if I need more swap.

However, my preference, is to use a relatively
small (256MB or 512MB primary swap space) and
(gasp) filesystem swap at very low priority with a maximum size of about 2x ram. I always configure enough memory that I never swap.
I then set up a separate dump area at a little more than 1x memory.

I just don't see the need for 2-3x memory (or 4-6x memory) for disk that is never going to be used.

Regards, Clay
If it ain't broke, I can fix that.
Shannon Petry
Honored Contributor

Re: swap space ??

I agree with almost everything stated. I too usually bump maxswapchunks to 1 1/2 to 2 times required to allow for expansion to swap without re-compiling the kernel. Too much does not impact performance so dont be concerned.

Swap really does not have any restrictions, however you have to know what it as and what it does to use swap and not blow up your system.

It is recommended that you have as much dump space as you have physical RAM. This is so that if your kernel panic's and dumps, it can fit the full memory extents to the dump area. At reboot the area can be dumped back to files and analyzed to see what caused the panic.

Since swap and dump can be the same device, I usually have my primary swap set to be the same as my RAM, but use this at a low priority.

I use multiple disks for primary swap where possible by striping swap across the disks, and set those to the same priority for performance.
I.E.
swap/dump pri=2
swap pri=1

If you dont like to stripe disks, then make many small swaps of equel size over as many disks as possible and set each to the same priority for syncronous access to swap.

Remember that Unix uses swap the way it should be. Pages do not go to swap unless memory is full, unlike Windblows that puts everything to disk all the time killing performance.

Remember too that file swap is much slower than device swap, which is much slower than RAM.

Regards,
Shannon
Microsoft. When do you want a virus today?
Patrick Wallek
Honored Contributor

Re: swap space ??

The maximum amount of swap is controlled by 2 kernel parameters - maxswapchunks and swchunk

See here for more information on maxswapchunks:
http://docs.hp.com/hpux/onlinedocs/os/KCparam.MaxSwapChunks.html

See here for more information on swchunk:
http://docs.hp.com/hpux/onlinedocs/os/KCparam.SwChunk.html