Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: Swap space requirements on 10g installs - must it really equal RAM?
Jay,
We just ran into a shortage of swap on our Solaris 9 box w/ 32GB of
pyhsical RAM. Your SA is wrong about Solaris 9 not allowing more than
4GB of swap. When we ran into the problem, we had 12GB configured. We
now have 2x RAM, or 64GB.
$ swap -l
swapfile dev swaplo blocks free114041840
/dev/md/dsk/d1 85,1 16 25175408 25175408
/dev/vx/dsk/prerac2_swapdg/san_swap1 278,30000 16 114041840
$ swap -s
total: 11541760k bytes allocated + 9175248k reserved = 20717008k used,
72014224k available
So, clearly the OS can see and use more than 4GB. (Time for a new SysAdmin? ;-))
Second, a bit about our problem, and why we have configured such a large (absurd?) amount of swap.
We had a 32GB box, w/ 12GB of swap. We are running 9.2.0.6, 64-bits, and though I don't think it's relevant to this discussion, this box has RAC configured.
With 12GB of swap, we never noticed any problems. Several weeks ago, I cranked up SGA_MAX_SIZE to 10GB, even though we were only using around 4GB at the time. Even with several hundred (dedicated) connections, total RAM utilization was way below the 32 GB that this box had. Well, last week, we started seeing some load related performance problems. One of the things I identified is that if I grew our default, keep, and recycle buffer caches, I ought to be able to significantly reduce some I/O. So, I did that, and it seemed to help.....until we hit our peak load part of the day, and suddenly Oracle connections are dying with TNS-12500-->TNS-12540-->TNS-12560-->TNS-00510-->Solaris Error 12: Not enough space. Well, it didn't take long, searching on MetaLink, to discover that meant swap space shortage. A little more searching, and I found two different papers citing that best practice for Oracle on Sun was that swap should be at least 2x physical RAM.
That seemed a bit excessive, but, with production servers down and you know the problem is shortage of swap space, are you really going to quibble over a few dozen GB of disk? Disk is (relatively) cheap. So, I told the sysadmin to go to 64GB of swap. Since we've done so, we've not had any further incidences.
One of the things I read (in Solaris Internals: Core Kernel Architecture by Mauro and McDougall), was that when a process starts up, an amount of swap equal to the memory of the process is "reserved". As that memory is actually used, a corresponding amount of swap is "allocated" from *physcial* swap as "backing store". This is required so that (quoting Mauro and McDougall) "an out-of-swap-space error can be reported synchronously during a system call."
This seems to imply that you absolutely need at least 1x RAM just to be able to effectively use all (or, nearly all) the RAM? This makes a certain amount of sense to me, but my doubt is rooted in my sysadmin's opinion that I've got this wrong. He claims that there's no one-to-one mapping of physical RAM consumed and physical (disk) swap consumed. And this from a sysadmin who seems to be pretty sharp and on the ball on all other counts and in my previous experience with him. Anyone with intimate knowledge of Solaris internals have any input?
Anyhow, the extra swap has solved the problem, and our server is happy, so the customer is happy, so my bosses are happy, so I'm happy....
-Mark
-----Original Message-----
From: oracle-l-bounce_at_freelists.org
[mailto:oracle-l-bounce_at_freelists.org] On Behalf Of Goulet, Dick
Sent: Tuesday, October 04, 2005 4:54 PM
To: JayMiller_at_TDWaterhouse.com; oracle-l_at_freelists.org
Subject: RE: Swap space requirements on 10g installs - must it really
equal RAM?
Jay,
I use HP-UX or RedHat vs Solaris & we set swap to 2 times ram. The reason is that swap gets used to hold an image of the operating process for diagnostic purposes in the event of a system crash. If we had less than ram for swap we could not start enough processes to use all of ram.
-----Original Message-----
From: oracle-l-bounce_at_freelists.org
[mailto:oracle-l-bounce_at_freelists.org] On Behalf Of
JayMiller_at_TDWaterhouse.com
Sent: Tuesday, October 04, 2005 3:00 PM
To: oracle-l_at_freelists.org
Subject: Swap space requirements on 10g installs - must it really equal
RAM?
Hello,
When installing 10G on dev and QA I had gotten the error that we should configure swap space to equal RAM. Since I figured out 4G of swap space was more than enough (why would we need 16G of swap space?) I ignored it, installed the software, created the database, and had no problems.
But one of the other DBAs was doing the production install and when he saw the message he balked and opened a TAR with Oracle. The Oracle support tech said that you *should* have swap set = to RAM. To be precise they said:
"...the database should not be installed on a machine having less than a
1:1
ratio of RAM to swap.
I would not advise skipping this message."
Speaking with one of the SAs he said the system won't even recognize more than 4G of swap.
Does anyone know of any reason why we would need more than 4G of RAM or (preferably :) why this isn't really important. Documentation for the latter would also be nice as I would now have to convince my management that this isn't necessary even though Oracle said it was.
Oracle 10.2
Solaris 2.9
16G RAM
4G Swap
Thanks,
Jay Miller
Sr. Oracle DBA
-- http://www.freelists.org/webpage/oracle-l -- http://www.freelists.org/webpage/oracle-l -- http://www.freelists.org/webpage/oracle-lReceived on Tue Oct 04 2005 - 17:23:14 CDT
![]() |
![]() |