Operating System - HP-UX
1849279 Members
5925 Online
104042 Solutions
New Discussion

Re: Swap Space Calculation

 
SOLVED
Go to solution
Vijaya Kumar_3
Respected Contributor

Swap Space Calculation

Hi
I am always in a confusion with swap settings with my HP-UX Servers. I have a N class server N5000-55 with 4 processors. This machine has 8 GB of memory. I found the system was configured with 6 GB ( 3GB primary and 3 GB secondary) of swap space (looks weird). I know it is not good.


I need a clear picture to set up Swap Space calculation on HP-UX Servers with large memory( >8 GB) and large applications like oracle, ERP etc.


Thanks in Advance
Vijay
Known is a drop, unknown is ocean - visit me at http://vijay.theunixplace.com
8 REPLIES 8
T G Manikandan
Honored Contributor

Re: Swap Space Calculation

It depends with the usage of memory and swap space on the system.

If your system takes heavy swapping/paging then you can think about increasing the swap space.

Else if your memory usage is minimal then you can think about enabling Pseudo swap.

How is the usage?
A. Clay Stephenson
Acclaimed Contributor

Re: Swap Space Calculation

First of all, the "state of the art" 1980's rules about needing 2-3x memory for swap (4-6x, if mirrored) very seldom apply these days. If you have swapmem_on=1 (pseudoswap) then the kernel will allow process space to exceed swapspace.

In almost every case, I configure only a small amount of primary swap (512MB-1GB -- you must have some primary swap), enable pseudoswap, and then monitor the system. In many cases no additional swapspace is needed. It's so easy to add swapspace that there is really no need to worry about it on the front-end. The reason you bought all that memory is so that you won't have to swap.

Finally, I have to tell you that 8GB's is not considered a large amount of RAM for Oracle and ERP. It's very common to see boxes with 32GB's of memory for these applications --- and yes they run just fine with very small amounts of swap.

If it ain't broke, I can fix that.
Brian Bergstrand
Honored Contributor

Re: Swap Space Calculation

Clay,

That brings up a question. With so small of a swap space (which I think is a good thing), then what do you do for dump space? Create an 8GB dump volume on vg00? Worry about it later?

Thanks.
Vijaya Kumar_3
Respected Contributor

Re: Swap Space Calculation

TG:
My memory usage are around 65 to 80% rightnow. I am worrying if i run out of memory in future?

Clay:
Thanks for your help. As you said i know the rule of thumb to have 2 to 3 times swap. I am not sure abt swapmem_on (set to on in my case).

Thanks
Vijay
Known is a drop, unknown is ocean - visit me at http://vijay.theunixplace.com
Steven E. Protter
Exalted Contributor

Re: Swap Space Calculation

The minimum swap space you need is half of memory. The reason for this is because thats the space you need for a dump of memory. You'll see a note on this in the Ignite/Install interface when you set up a new system.

Beyond that your ideas concerning not needing a ton of swap space are correct. The old rule of swap 2.0 times RAM don't apply unless the machien is really overloaded.

The A. Clay Stephenson school of swap says set up a small primary swap area and then a larger secondary one. This sets gets you excellent performance, particularly at low load factors.

The maximum amount of swap is 16 GB, based on a hard kernel limit in HP-UX 11.11 anyway.

Once you are running, you need to check actual swap utilization. I went through an elaborate process of calculating swap on a trio of rp5450 L class servers and every time I check its not using any.

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
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: Swap Space Calculation

No, my rule of thumb is NOT to have 2-3x swapspace -- that rule died somewhere in the 1980's -- for almost all applications. Here's the deal, if pseudoswap is not enabled, on your box with 6GB of swap and 8GB of memory, you can have no more than 6GB of process space; However, if swapmem_on=1 then you can run 1.75 the total of swap + memory. Note that there is no such thing as pseudoswap, it's not "swapping" anywhere. It's just a kernel bookkeeping method that allows the system to exceed the swapspace.

I also take the view that dumpspace and swapspace have nothing to do with each other and there is certainly no need to mirror dump space but a great need to mirror swap space.
If it ain't broke, I can fix that.
Stefan Farrelly
Honored Contributor

Re: Swap Space Calculation

My guidelines are;

Swapsize = RAM size.
pseudo_sap = 1 (always on as its a good safety net should you run out of swap)
forget dumpspace, should a crash happen you can savecore it away on reboot to anywhere.
Im from Palmerston North, New Zealand, but somehow ended up in London...
Bill Hassell
Honored Contributor

Re: Swap Space Calculation

A quick note about crashdumps. If the dump lvol is not shared with swap, then you can save the crash anytime after reboot. But if swap = dump lvols then you have a very short window of opportunity to save the crash before it becomes corrupted by swap activity. Even massive RAM, there can be some paging activity due to memory mapped files. Except for a few very strange program problems, all crashdumps have the info needed for analysis in the first 400-500 megs and you can configure crashconf to just save HP-UX areas.

One artifact seen with Oracle and also with SAP. Once installed and running, they will not need multi-Gb of RAM, but during installation, you may need 5-10Gb of swap space because the installer requires massive amounts of RAM. This is simple to accomodate: just use swapon to add either raw of filesystem sawp space to reach the 5-10Gb level, install and reboot. The swap space is temporary using swapon.


Bill Hassell, sysadmin