Operating System - Linux
1753767 Members
5721 Online
108799 Solutions
New Discussion юеВ

How much of a swap file do you need??

 
SOLVED
Go to solution
Ian Derringer
Regular Advisor

How much of a swap file do you need??

Hi,
I am getting ready to setup a Itanium RX4640 4x1.5Ghz and 16GB of RAM running RH Linux AS 3.0 - I know rule of the thumb is that you must create a swap file that's double the size of your RAM. So, if I have 16GB of RAM then I should create a 32GB of swap file, correct? By the way, I will also have Oracle 10g running on this server as well. I believe Oracle usually like to set the SGA higher than most, therefore, it uses more memory then the swap disk.

Can someone direct me to the right direction?

Thank you in advance.
Ian
15 REPLIES 15
Vitaly Karasik_1
Honored Contributor
Solution

Re: How much of a swap file do you need??

As far as I remember, you should create just 2GB swap partition, not more.

Check RHEL installation manual for more.
Srikanth A_1
Occasional Advisor

Re: How much of a swap file do you need??

SWAP thumb rules is 2 times of mem
guess even with oracle 2 times of mem will do
Huc_1
Honored Contributor

Re: How much of a swap file do you need??

I think the following information is still valid with newer version of oracle.

http://www.puschitz.com/TuningLinuxForOracle.shtml#SizingSwapSpace

J-P Huc
Smile I will feel the difference
Wim Van den Wyngaert
Honored Contributor

Re: How much of a swap file do you need??

I wouldn't give a lot to systems with 16GB.

On systems with a few hundred MB of memory yes, because most applications simply don't have enough with that.

If you are trying to use the complete physical memory, you can should use a swap space of let's say 4 GB. Just as an overflow area when things go wrong (programs allocating more memory than normal). When you have thousands of sessions on your system, it may be a good thing to have a lot of swap space (for parking non-active user).

Wim
Wim
Stuart Browne
Honored Contributor

Re: How much of a swap file do you need??

When you're using that amount of RAM, I guess the rule gets relaxed a bit, but i like to have at least the same amount of swap as I have physical memory.

Espeically with the Enterprise based distributions which include the ability to send memory dumps upon crash to swap for diagnosis.

If you've got the disk space of course ;)
One long-haired git at your service...
Steven E. Protter
Exalted Contributor

Re: How much of a swap file do you need??

On larger HP Integrity systems with lots of RAM, say 16 GB, you do not need to have 16 GB of swap. 8 GB is probably enough.

This however depends on use. If push the system hard and have lots of swap reservervation or actual swap use,you will need more swap.

Once there is not enough swap left for a process to reserve swap, even if there is no actual paging, the process will fail to start and indicate in the error message that the system has unsufficient memory.

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
dirk dierickx
Honored Contributor

Re: How much of a swap file do you need??

swap size, a debate that has been going on since it got invented. one conclusion is that there is no 1 rule fits all. depending what you are doing with your system, the rules change.

according to the redhat oracle 9i deployment guide it says swap should be 2x ram with a minimum of 1024MB.

i would go with red hats recommendations.
Andrew Cowan
Honored Contributor

Re: How much of a swap file do you need??

If you create a very large swap/paging file the system will have to devote a sizeable amount of time to managing it. If you absolutely must have this much, try splitting it evenly amongst several disks and volume groups, and try to pick the least busy ones.

There did used to be a physical limit on the swap size of 2Gb, and as far as I know this was originally due to a filesystem limitation (on size of an idividual file). RHAS-2.1 quotes a max of 6 X 2GB, but I cannot find anything for RHAS 3.x so I would expect it to be the same.

I would suggest creating several equal sized files e.g. 4 x 1Gb and then monitor how much Oracle is actually using, then you can always add more later. This is always dependant on the number of disks you havve.

On IBM/AIX they say that you should have one realtively small paging area that is large enough to boot-up etc, and then several other equally large paging spaces on other disks, and in other volume groups. I've never tried this, but think that it should work just as well for LInux.
Wim Van den Wyngaert
Honored Contributor

Re: How much of a swap file do you need??

I'm actually a VMS man and don't know the details of Linux Swapping but consider :

1) is linux able to move a process from one file to another when swap space is full or will the process simply abort ?

2) will processes be distributed over the different swap files or is e.g. the 2nd only used when the first one is full ?

3) what performance will an oracle server get when his virtual memory is outswapped ? E.g. if you do a join of 1 M row it might have to do 1 M swap-in-out to get the correct data. Will Linux find another victem with less activity ?

Wim
Wim