Operating System - HP-UX
1849227 Members
6896 Online
104041 Solutions
New Discussion

shmmax and swap size recommendations

 
SOLVED
Go to solution
Neil Smith_3
Occasional Contributor

shmmax and swap size recommendations

I am trying to understand the recommendations for swap size in relation to shmmax parameters.

Current system:

rx4640 (4 CPU)
64gb physical memory
HPUX 11.23

We are looking to run a single PG database on this system, and obviously would like to run as large of DB Shared_buffer Cache as possible.

In this case if we ran 20gb DB Shared_buffer Cache, with a shmmax=32gb. What would be the recommended size of swap?

Note: Psuedo Swap is enabled.

4 REPLIES 4
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: shmmax and swap size recommendations

Without meaning to be flippant, the answer is as large as it needs to be. With pseudoswap enabled, your need at least 0.25x RAM configured as swap to fully utilize your virtual address space. I would configure 16GiB of device swap and then monitor the system for actual page outs.

Although you didn't ask, swap and dump space should have absolutely nothing to do with each other and I would configure about 16GiB of dump space; that will be more than adequate to capture crash images.

Finally, every dab of your swap space should be mirrored; dump should not.

If it ain't broke, I can fix that.
Tim Nelson
Honored Contributor

Re: shmmax and swap size recommendations

As a note: shmmax and swapspace really have nothing to do with each other.

To ensure that you can use the 64Gb of RAM you will need to have 64GB of swap.

Although typical recommendations say 1.5 or 2 x swap as physical ram this is outrageous for a system with 64GB of RAM.

You would never want to swap on a system as the performance drag is terrible. Configure 64GB so you can use the entire 64GB of RAM. To be safe so your processing does not stop at 64GB then add 10% more (70GB).

If you feel that 70GB of swap space is a waste of storage then allocate less, just beware that you will not be able to use more memory than you have psuedo or physical swap for.

Monitor your mem usage. If you approach the 64GB mark then buy more memory before a problem occurs.
A. Clay Stephenson
Acclaimed Contributor

Re: shmmax and swap size recommendations

Sorry Tim, this statement is false (if pseudoswap is enabled as it is in this case):
To ensure that you can use the 64Gb of RAM you will need to have 64GB of swap.

Pseudoswap is a little kernel bookeeping trick that allows the kernel to count 75% of RAM as swap space for purposes of calculating process reservation space. Thus all that is needed in this case to use the full 64GiB as VAS is 16Mib of device swap + the 48GiB of pseudoswap (which isn't swap at all). This is really a mechanism that allows a box to run with much less swap than memory. In this case swap space at 1X memory -- which would be 2X if mirrored would result in a great deal of unused disk. You bought all that memory so that you would never swap.

If it ain't broke, I can fix that.
Steven E. Protter
Exalted Contributor

Re: shmmax and swap size recommendations

Shalom,

Several of the newer Oracle application server products requires shmmax to be equal to physical memory before they install.

Setting that high doesn't mean its really that high, it just makes oracle happy.

shmmax will be ignored if its greater than 25% of memory, which HP-UX defines as swap plus ram. Well not totally ignored, it will just be set to 25% of memory as defined by HP-UX.

With that much RAM, you really don't need much swap. The OS can become unstable if swap is not at least 50% of RAM.

I know of a case where on a 32 GB RAM server a company was annoyed that the cold install program would not let them set swap to 8 GB.

So they did it manually after install. Then they were surprised when their system became unstable and started crashing. Unless you have serious memory pressure set your swap to half ram and be happy.

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