1834640 Members
3185 Online
110069 Solutions
New Discussion

Re: how much swap space

 
Darren Murray_1
Frequent Advisor

how much swap space

I have a system with 12gb of ram, 12gb of swap space set with the kernel parameter swapmem_on turned on.

I have had the following been sent by SAP

"For minimizing the memory errors seen in process trace etc, I would like to
propose increase in swap space to at least 20 GB (for this particular setup
with 4 instances running on same server, 50 GB swap is recommended as per
the SAP Note 153641). Currently swap space is only 12GB."

I would have thought that 12Gb of swap space with swapmem_on turned on would have been sufficient.

Anyones thoughts?

9 REPLIES 9
Marco Santerre
Honored Contributor

Re: how much swap space

Unfortunately, I'll have to agree with SAP on this one. I, too, thought that because I had a higher end model of server with higher RAM capacity that I didn't need as much swap, because I was thinking "Wow! 50 gigs of swap.. that way too high", but you know what, I didn't have too much of a choice, as it took at least, 1.5X the amount of memory, and thru that the real recommendation is 2-3X the amount of memory for swap.
Cooperation is doing with a smile what you have to do anyhow.
AwadheshPandey
Honored Contributor

Re: how much swap space

i m agree with SAP, 12Gb swap space is less for ur server, u should use at least 3X swap of memory.

Awadhesh
It's kind of fun to do the impossible
Bill Hassell
Honored Contributor

Re: how much swap space

You may want to leave the 12Gb of swap and simply monitor the space with swapinfo -tam. Although SAP recommends massive amounts of swap space, the majority of SAP systems (with more than 8Gb of RAM) report that virtually *NO* swap space is ever used at all except for a few hundred megs for memory mapped files. This includes reserved swap space (unused but reserved by HP-UX based on program sizes). If SAP needs additional swap space, it will be reported as reaching a RAM or memory limit.


Bill Hassell, sysadmin
Stuart Abramson
Trusted Contributor

Re: how much swap space

We set the "swapmem_on" to 0, and then set swap equal to the size of memory.

If you have big enough memory you don't want to swap, and you don't need the big swap space.
Patrick Wallek
Honored Contributor

Re: how much swap space

The first thing I would ask is exaclty WHY they want that much swap space? Are they expecting to start 20GB or 50GB worth of processes?

Kent Ostby
Honored Contributor

Re: how much swap space

HP generally recommends a minimum of 2xRAM worth of disk swap.

For Oracle and SAP, the recommendation can be as high as 3xRAM if there are system performance issues.

I would recommend a minimum of 20 to 24 GB of physical disk swap.

I would NOT set swapmem_on to 0. The problem with doing that is that if you have to boot into LVM maintanence mode, you will panic because you will not have any way to swap.

I suggest turning swapmem_on to 1, but limiting your dbc_max_pct to 10 which will keep you from using too much memory for dynamic buffer cache.

Best regards,

Kent M. Ostby
"Well, actually, she is a rocket scientist" -- Steve Martin in "Roxanne"
TwoProc
Honored Contributor

Re: how much swap space

I've seen this mainly from anyone using an Oracle database(SAP, Oracle Apps, Peoplesoft,etc). HP has pseudo-swap to address this issue b/c if you have a server with 32 or 64GB of ram it's ridiculous to consider 1.5x to 3x that much in swap as you're purposely setting up the system in such a way that precludes needing it. That is, you're going to put a bunch of ram in the box to avoid unwanted swap events.

Periodic runs of "swapinfo -tam" will tell you if you are using it (suggest launching this in cron hourly and giving to the SAP team). But, I think 12G of swap for 12G of ram is just fine - with pseudo-swap enabled - IF "swapinfo -tam" tells you that you're not entering swap (other than just marking a block for later use, but not actually swapping to it).

The reason is, that under their(Oracle Consulting and Tuning Group, Oracle implementation team, most any DBA tuning group, etc) thinking, if the swap is not there, Oracle may continue to operate, but would run very slowly and present a bottleneck. I've heard wild tales of Oracle databases experiencing 100% performance gain when swap space is set up according to Oracle methodologies on HP boxes: however, Oracle setup standards don't ever address the configuration of psuedo-swap. While I can believe that a bottleneck could be possible without enough swap space and without psuedo-swap as a backup, I don't you'll see it here.

I *did* have an Oracle guy here who came to tune one of their ill-running pieces of junk code, and he INSISTED that we follow standards and put in all of the required swap (2X for him), and, sure enough - it didn't change a thing b/c we have psuedo-swap installed: as I told them it would.

A recent search on Metalink and otn.oracle.com turned up no valid hits on the
subject of HP and pseudo swap. By Oracle failing to even recognize that pseudo swap is a standard setup alternative, you're left with the old 1.5x-3x system memory guideline.

If the SAP guys wish to pursue this and you have the space, set up a test with a serious load on it, both with and without the extra space and pseudo-swap. Then make them stick with the results of the test for the final configuration.
We are the people our parents warned us about --Jimmy Buffett
Greg Vaidman
Respected Contributor

Re: how much swap space

A recent SAP implementation we did yielded the following simple swap recommendation from SAP, although I doubt I could find the source of the info at this point.

Start with 20GB, and add 10GB for each additional SAP instance you're running.

So, 20GB for 1 instance, 30GB for 2, 40GB for 3, etc.

This proved to be much more palatable than 2x swap on our 32GB and 64GB systems.
Ted Buis
Honored Contributor

Re: how much swap space

I would leave swapmem_on turned on. There is little reason to turn it off if you never page out. It will increase your available virtual address space, in case you need it, beyond the 12GB of physical device swap. However, if you do page-out regularly, then 2X or larger physical device swap than memory and swapmem_on turned off, could help even out performance. This is because pseudoswap locks pages into memory and those few pages that aren't locked will unfairly be paged-out. A better explaination can be found in the HP-UX internals book by Chris Cooper and Chris Moore.
Mom 6