Operating System - HP-UX
1834669 Members
2081 Online
110069 Solutions
New Discussion

Re: How much Primary Swap

 

How much Primary Swap

I am about to install a rp7400 (N-Class), 4 cpu, 2 va7100, 16GB memory. What is everyones on how much Swap space is required and should it all be on the 36GB root disk or spread about?
9 REPLIES 9
Mark Mitchell
Trusted Contributor

Re: How much Primary Swap

I start with 25% of memory in size, then see how much of it gets used if any. With that much memory on the server you may not see a whole lot of paging, but my experrience is with oracle apps.
A. Clay Stephenson
Acclaimed Contributor

Re: How much Primary Swap

Here's a better question. Are you going to swap at all? If 16GB's will ensure that you don't swap, then believe it or not, you can get by with a very small amount (512MB or so) or primary swap and that's it. You must enable pseudoswap (swapmem_on=1). In all but a few very specialized cases, the old rule about 2x-3x RAM for swap (4x-6x with mirroring) very seldom apply.

In large RAM configurations that never swap, I generally configure a small amount of primary swap (mirrored), a separate dump area (not mirrored), and either configure pseudoswap OR the dreaded filesystem swap at low priority. Since, it is not going to be used who cares if it's filesystem swap. I just can't bring myself to dedicate a whole bunch of mirrored disk to do absolutely nothing. That's why I spent all the money on the RAM in the first place.
If it ain't broke, I can fix that.
Sandip Ghosh
Honored Contributor

Re: How much Primary Swap

I would start with 4 GB of primary swap on the root disk and watch the system for swapping. If it started swapping and if I could see that 4 GB is not enough then I would create another 4 GB on a different disk.

Sandip
Good Luck!!!
Mark Mitchell
Trusted Contributor

Re: How much Primary Swap

Do yourself a favor, start with 512 on the root disk and add another 3 1/2 If it does not
seem to be needed you can take the entry out of the fstab rather than go through the steps to reduce the primary swap size.
Roger Baptiste
Honored Contributor

Re: How much Primary Swap

hi,

you have 16Gb RAM . If you set pseudo-swap (swapmem_on = 1 ), then you will have 12Gb pseudo-swap setup. So, i would create a 2 Gb primary device swap and monitor how the swap is being used. If more swap is needed, add 2gb secondary device swap (either on vg00 or on other disks).

HTH
raj
Take it easy.
Trond Haugen
Honored Contributor

Re: How much Primary Swap

Mark, A. Clay and Sandip all have good answers. Remember to give them points.
In line with their answers it don't matter where you put the swap as you won't expect it to be used.
IF you had expected swap to be used (a lot) the best practise would have been to spread it across several disks and FC/SCSI controllers. As you would also do with filesystems with lots of access.

Regards,
Trond
Regards,
Trond Haugen
LinkedIn
John Payne_2
Honored Contributor

Re: How much Primary Swap

The only thing you want to think about with where to place the swap is that a) you are problibly not going to use it, b) the primary swap has to be on your root vg, and c) if you are mirroring those 2 internal disks for failover, you want to have your primary swap available in the event that a disk fails.

Given those 3 cases together, if all 3 apply, just put the small swap (as properly suggested) on your root vg, and let it rip. You likely will not use the swap, and it should not be a problem to have it sitting on the internal disk.

Hope it helps.

John
Spoon!!!!
Sridhar Bhaskarla
Honored Contributor

Re: How much Primary Swap

The good thing about HP's primary swap is that you can't change the default priority value of "1". This allows you specify 0 (high priority) for the additional swap devices.

I would create primary swap only to the size that is required to boot the OS with swapmem_on to make the system feel that it has enough swap available. Then I will create device swap(s) on an external storage with priority 0. This will make me feel good as I will not straining my root disk in case of memory constraints.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Bill Hassell
Honored Contributor

Re: How much Primary Swap

As mentioned, 16Gb of RAM is a huge amount and if all the applications don't add up to about 15 Gb, then you'll never use the swap space (a small amount may be used by memory mapped files). So the recommendations for very samll swap areas are correct (500 megs or so).

Swapping is a bad thing...it slows everything down if pages of RAM are being swapped out and back in again (continuously). In the old days (tm), RAM was very expensive so swapping was a necessity and interleaving swap and specifying alternate swap areas with priorities was very common. Today, with adequate RAM, this is not a useful exercise.


Bill Hassell, sysadmin