1833044 Members
2757 Online
110049 Solutions
New Discussion

swap space

 
SOLVED
Go to solution
Jeff Hagstrom
Regular Advisor

swap space

I have an RP 7410 HPUX 11.i, 2 processors and 14 gig of ram. My questions is about swap space. Do I have enough? How much should i have? Is there any software to tell me if my swap space is being maxed out and I need to add more?
6 REPLIES 6
Yang Qin_1
Honored Contributor

Re: swap space

DCE
Honored Contributor
Solution

Re: swap space

The old rule of swap space = 2 X memory is outdated.

On newer systems with lots of memory it is waste of disk space. Hoever, you do need to have at least 1x memory for full utilization of the memory. If you have the kernel swapmem_on=1 in the kernel, then you have pseudo swap enabled. That means, you can specify less thhan 1x memory physical swap, and the system will still think there is more than that available.

Do a search fo pseudoswap on this forum for more info.

I would do 7 GB physical swap, with psuedoswap enabled. If you swap out more than 7 GB physical swap, your system performance is going to tank anyway.

Sandman!
Honored Contributor

Re: swap space

You can look at glance to tell you about swap space usage and post the output of the following:

# swapinfo -mat

thanks!
Brian A. Scurlock_1
Frequent Advisor

Re: swap space

Without pseudo swap enabled, you MUST have at least 14 gb of swap to match your 14 gb of physical memory. This is because HPUX preallocates or "reserves" the swap space for processes in physical memory. Your available physical memory is limited by the availability of space available to reserve in swap.

-Brian
You can do anything you set your mind to when you have vision, determination, and an endless supply of expendable labor.
Sandman!
Honored Contributor

Re: swap space

Check out the tkb doc below...it deals quite exhaustively with usage and guidelines reagrding swap.

http://www1.itrc.hp.com/service/cki/docDisplay.do?docLocale=en_US&docId=200000072951343

~cheers
A. Clay Stephenson
Acclaimed Contributor

Re: swap space

14 GiB qualifies you (although not by a wide margin these days) as a system with lots of memory. The rules for such systems nowadays are very different from the rules of yesteryear which stated that you need 2X or 3X memory configured as swap space (which becomes 4-6X if mirrored). My answer for you is "as much as you need and no more". There is software that will tell you if swap is maxed out and if you need more. It's called "swapinfo" and "vmstat" and both and built in to your system. Another is Glance but you have to pay for that one. Essentially, look am vmstat's output and examine the pageout (po) column. Ideally, that value is zero which means that you have no memory pressure and aren't using swap at all. If that is the case then all swap is actually used for is to reserve space just in case a process does have to be paged out but since you aren't actually swapping then we can fool the process reservation space algorithm by enabling pseudoswap. This allows the kernel to pretend that 75% of your memory counts as reservation space so if you have 25% of physical memory configured as actual swap space you can use your entire physical memory as process space.

In your case, I would configure a swap space equal to 25% of physical memory, set swapmem_on=1, and monitor pageouts with
Glance or vmstat. You should also go ahead and increase the kernel tunable maxswapchunks to accomodate your maximum anticipated swap space. If you do this and leave some unfigured space in your VG's, it's so easy to add additional swap space that it's not worth worrying about. You can do it "on the fly".

It is very common these days to have systems with much more memeory than swap space and they run just fine.

Now, each and every dab of swapspace should be mirrored so that you don't have to shutdown to replace a disk or so that your system will continue to run with a failed disk.

Finally, in my view, swap and dump space should have absolutely nothing to do with each other and should be allocated separately --- and dump should never be mirrored.
If it ain't broke, I can fix that.