Showing results for 
Search instead for 
Do you mean 

Amount of Swap required?

SOLVED
Go to Solution
Occasional Advisor

Amount of Swap required?

We are setting up a N-class server with 12gb of mem. THis is an oltp type server as it's major application. Most time the rule is swap=2xmem which would be 24gb of device swap. I can not believe that I need 24gb of disk space for swap on this box. Can someone let me know their experiences or recommendations.

thnx
life is too short to work so long
9 REPLIES
Honored Contributor

Re: Amount of Swap required?

A lot of such questions have been asked, you'll get "personal experiences" answers a lot. However I'm attaching a doc "everything you want to know about swap".
Hope it helps a little.
Honored Contributor

Re: Amount of Swap required?

The majority of my N-class servers have 8Gb of memory and all I have is the default 4Gb of swap.... It does fine, but as always, your application and the size of your audience will drive this requirement. In any case, whatever you decide, I know that 24Gb is too much, way too much.

Hope this helps and good luck.

Chris
It wasn't me!!!!
Acclaimed Contributor

Re: Amount of Swap required?

The answer is that it depends. The bad news is that if you use the old 2x rule then that becomes 4x with mirroring. You are going to mirror swap, aren't you? These days it is very unusual to require that much swap. You have a few options:

1) Do it the old way and use the 2x-3x rule but in general this is dumb because you bough all that expensive memory so that you wouldn't have to swap in the first place!

2) Configure a small amount (256-512MB) of primary swap (mirrored); you must have some and then enable pseudo-swap. This allows your system to think it has swap so that processes can run.

3) Same as 2 but swapmem_on = 1 and something like 1-1.5x RAM configured as filesystem swap at low priority. Normally filesystem swap is bad but in your case you almost certainly aren't going to be using it so that there is no downside. This doesn't even eat disk unless it's actaully used.

If you're are not going to swap, plan 3 is probably the best. If you are going to swap then configure device swap.

NOTE: If you choose the small primary/filesystem swap option, you should think about setting up a separate unmirrored dump area.

Food for thought, Clay
If it ain't broke, I can fix that.
Acclaimed Contributor

Re: Amount of Swap required?

Hi again: Plan 3 should have said swapmem_on=0; no pseudo-swap.

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

Re: Amount of Swap required?

Hi,

This topic has been discused many a times in this forum. The answwer is always it depends.!

The following thread might be helpfulhttp://forums.itrc.hp.com/cm/QuestionAnswer/1,11866,0x997cabe92dabd5118ff10090279cd0f9,00.html

Goodluck,
-USA..

Good Luck..
Honored Contributor

Re: Amount of Swap required?

I would go along with Clay's suggestion with one exception - make sure you have enough primary swap so that the system can save a crash dump after a panic. When the system panics or is TOC'd a copy of parts of main memory are written to the dump devices which are usually always configured on swap volumes. This dump is then copied to /var/adm/crash when the system reboots. Believe me there's nothing worse than explaining to management that you can't give them root cause on a system failure because you didn't get a complete dump.

To be on the safe side I would suggest about 1Gig of primary / secondary device swap (mirrored of course, so 2Gig total space used) which is also configured as dump volumes with lvlnboot. According to "crashconf -v" my system needs about 500Meg of space for a dump.

Regards,
Steve
Honored Contributor

Re: Amount of Swap required?

Hi Mark,

You don't need to go for 2xMem formula for swap spaces. You can go with minimum swap space. It's better to keep the primary swap as little bigger like 3GB etc., You can also enable pseudo-swap to fool the system. It's not really used as swap but tells the system that it has got device swap+pseudo-swap amount of the swap available so that "reserve" will be taken care effectively.

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

Re: Amount of Swap required?

HI
With pseudo swap enabled you can be minimum on device swap.
My N-class machine with 11GB ram is running with 1GB swap.

Thanks.
Prashant.
Take it as it comes.
Honored Contributor

Re: Amount of Swap required?

Hello Mark,

since with "swapmem_on=1" you can use up to 75% of your RAM without being *backed* by swapspace, you'll need at least swapspace for the remaining 25% of your RAM.
But make it mirrored - you wuld not like your whole system to dump for a simple disk-failure on the swapspace, would you?

Just my $0.02,
Wodisch
//Add this to "OnDomLoad" event