1834645 Members
2187 Online
110069 Solutions
New Discussion

Re: swap requirements

 
SOLVED
Go to solution
Juan M Leon
Trusted Contributor

swap requirements

We are upgrading the memory on 4 of our servers. This servers are running SAP application and database.
We are increasing memory to 16GB and 20GB with 4cpus on each server. Any suggestions as what will be a good swap space.
- Same as physical memory
- double the size of physical memory

Can you explain why?

Thank you all for your input.
5 REPLIES 5
Alex Glennie
Honored Contributor

Re: swap requirements

James R. Ferguson
Acclaimed Contributor

Re: swap requirements

Hi:

Given that you already have some amount of primary device swap, I'd simply add enough secondary device swap to yield device swap at equal to your physical memory, *but* make sure that you have pseudoswap enabled in the kernel --- 'swapmem_on=1'. Enabling pseudoswap means that 75% of your memory can be counted for process swap reservation during process initiation. This is a kernel "accounting" trick and does not mean that any swap space is actually used.

Monitor your swap utilization with 'swapinfo'.

Regards!

...JRF...
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: swap requirements

At one time, SAP looked for 3X swap space upon installation and would not install unless that requirement were met. I understand that that restriction has been dropped. In any event, I always created as much swap space as I anticipated needed and then made up the remainder of the 3X requirement using the dreaded, awful filesystem swap. Once installed, the space was not needed so I removed the filesystem swap space.

The real answer to your question is as much as you need and no more. You should configure at least 0.25X memeory as swap space and enable pseudoswap (swapmem_on=1). This will allow 0.75X of your memory to be treated as swap space for purposes for reservation calculations. You then monitor swap usage. It's so easy to add additional swap space as long as you have unused disk space that it is hardly worth worrying about. You should also increase maxswapchunks so that a reboot will not be needed in case additional swap space is actually needed. You goal should be to actually never swap so that none of the swap space is actually used.

Every dab of your swap space should be mirrored. If you add more swap than memory then disable pseudoswap as it then serves no purpose.

You should also decouple the dynamic buffer cache from the amount of memory so that memory adds do not grow buffer cache beyond reasonable, optimal sizes. You do that by setting bufpages to a nonzero value equal to the number of 4K pages. A value some where between 800-1600MB (bufpages=204800-409600) should be about right.
If it ain't broke, I can fix that.
yunardi
Frequent Advisor

Re: swap requirements

Hi Juan,

I suggest you to have at least double of memory for swap.

I have running 4 SAP instance on my machine, it have 9GB Physical Memory. The swap util is about 9GB to0, but the load of machine (cpu) is very low because its use for development.

In another machine, I'm running 1 instance of SAP (production), it have 8GB Physical Memory and swap util is about 7GB.

Now what happen how if I configure the swap same size with memory ?

I have another example, while running Datawarehouse application/database on my Superdome with 44GB physical memory. There was 2 time when the system runs out of memory and swap utilization is 100%.. the system hang/crash. Then I configure another swap device so total swap is 90GB, its better now :)

Thx,
EKO
Juan M Leon
Trusted Contributor

Re: swap requirements

Thank you all for your information