Summary swap rules.

From: <>
Date: Thu Mar 13 2008 - 16:55:28 EDT
I was asked nicely to not post these types of questions in the future 
because it's off topic for this list.
The list is supposed to be more of a break/fix type of list and not an 
informational list(didn't know until I read the faq).  That said, this 
topic was pretty popular.
And for those who want to see what is about, read the FAQ. 
 It has lots of useful links on it pointing to lots of solaris based admin 
stuff (finally read it today- it's good!)

So it looks as if swap is mostly not used anymore and can be kept pretty 
small.  Unless you're running an application that uses lots of swap or 
tempfs.  Examples of needing swap were systems compiling lots of stuff and 

Favorite posts:
Tim Bradshaw stated what I privately felt- that 1:1 swap to memory is 
becoming impractical on largish systems given the size of boot disks- this 
is what I'm facing now... sizing swap for 32 gb intel blades and a 64gb 
niagara2 blade w/73gb boot disks. Seems a bit tight to do a 1:1 swap to 
memory ratio.
Jeremy Gillow's answer got to the heart of the matter with sun 
documentation for solaris 10... read on below.

Dean Ross-Smith
Unix Admin
Las Vegas Review Journal/Stephens Media.
The person who mailed me saying my question is off topic, also mentioned 
that Oracle 10g recommends 8GB minimum swap.

Kiran Sharma wrote:
I think there is some math goes. If ram is more then 4 gb then swap is 
4gb. I think its upto ggb ram 4 gb swap. 16gb ram 8 gb swap. 32 ram==>> 16 
gb swap.
Thats what I did for Redhat server we had and also for 880 and t200 

Dave Kensiski wrote:
I have systems with 12 to 16 GB of RAM and as a rule just make my swap a 
fixed 4GB space.  As you said, we don't actually use swap on a day-to-day 
basis (in fact, I have Nagios configured to alert me if it gets used at 
all!) so it's really only around for memory leaks and core dumps.  Unless 
you have a really fast memory leak, 4 GB should provide you enough time to 
do some diagnostics before you restart the leaky application, and it's 
certainly enough for an OS core dump.

Ric Anderson wrote
"I'd say a disappearing standard.  System dumps seem to just include
the kernel and a hand full of data structures - no where near
all of RAM.  What drives my decision is how much virtual address
space (ab)users will need.  Since Solaris computes VM Size = RAM+Swap
these days, I try to get enough RAM to hold all the resident
sets for applications, and then let swap space absorb the VM needed
beyond the resident set size (with some extra space in both
to allow for growth and for kernel overhead).
Matthew stier wrote
This is an old BSD  vs SVR4 issue.

You can run a Solaris 2 or later system without swap; and if you do add 
some, it is simply used to increase the systems virtual memory.

Personally, I do setup a 20GB swap partition on the large memory systems 
I do have, simply because the disk is available, and it is a place for 
the kernel to stash a core during a crash.
Peter van Gemert wrote
Solaris 9 & 10 do not followi the old UNIX way of allocation memory of 
reserving memory against physical memory. This UNIX way was the mean 
reason for configuring a swap partition twice the size of your 
internal memory.

Solaris 9 & 10 (and I believe 8 as well) allocate memory against 
virtual memory. This means that if you know for _sure_ that you have 
enough memory so that swapping will not occur, you might configure 
Solaris without any swap partitions at all. Solaris will then run 
completely from internal memory without any problems.

Biggest caveat is of course crash dumps (which you call core dumps I 
think) which are written to swap space. If you want to save crash 
dumps you could have a swap partition large enough to hold the largest 
crash dump. Another solution might be saving crash dumps in a reserved 
partition. Take a look at the dumpadm command how to do this.

Tim Bradshaw wrote:
It's typically now becoming impractical to provide as much swap as 
memory on many machines - lots of systems have 72GB boot disks (may be 
146) but much more memory than that.

The only things you *need* swap for are to deal with memory shortfalls 
(should be very rare, and if you get significant shortfall you have 
other problems), and crash dumps.  Even on huge systems crash dumps 
are not often bigger than a few GB, since all you really need is 
kernel storage, and often not all of that.  So I don't generally see 
much use for swap slices bigger than, say 16 or 32GB and often much 
smaller (4-8GB should be more than enough for most things).  There are 
probably weird exceptions.

Jeremy Gillow wrote:
"Sun has a reference guide

4GB swap is the max we usually do now, but if you are in the 16-128gb
range 8GB would be better I think.

Jeremy's referenced document is:
"Solaris 10 System Administrator Collection >> System Administration 
Guide: Devices and File Systems >> 20.  Configuring Additional Swap Space 
The most important factors in determining swap space size are the 
requirements of the system's software applications. For example, large 
applications such as computer-aided design simulators, database management 
products, transaction monitors, and geologic analysis systems can consume 
as much as 200b1000 Mbytes of swap space.
Consult your application vendors for swap space requirements for their 
If you are unable to determine swap space requirements from your 
application vendors, use the following general guidelines based on your 
system type to allocate swap space.
System Type Swap Space Size     Dedicated Dump Device Size 
Workstation with about 4 Gbytes of physical memory      1 Gbyte 1 Gbyte 
Mid-range server with about 8 Gbytes of physical memory 2 Gbytes        2 
High-end server with about 16 to 128 Gbytes of physical memory  4 Gbytes  
4 Gbytes 
In addition to these general guidelines, consider allocating swap space or 
disk space for the following:
        b"       A dedicated dump device.
        b"       Determine whether large applications (such as compilers) 
will be using the /tmp directory. Then, allocate additional swap space to 
be used by TMPFS
---snip--- wrote on 03/13/2008 07:44:19 AM:

> Hi managers.
> What are the general rules for sizing swap on current systems?
> As cheap as memory is getting these days the newer systems we are 
> with have 32 or 64GB ram.
> Back in the day when memory was expensive, a 2:1 Swap partition size to 
> RAM ratio was pretty normal.
> Then It was 1:1 as memory has gotten cheaper.
> Is it still a good practice to do 1:1 to allow for huge core dumps on a 
> crash?
> Or is 1:1 Swap:RAM a disappearing standard too because swap isn't used 
> much anymore?
> I'd be curious to hear from admins that run systems with under 128GB ram 

> and admins that run really large memory sun boxes too... how do you 
> swap on systems with a bunch of RAM?
> I'll summarize what I get back...
> Thanks all!
> Dean Ross-Smith
> _______________________________________________
> sunmanagers mailing list
sunmanagers mailing list
Received on Thu Mar 13 15:55:43 2008

This archive was generated by hypermail 2.1.8 : Thu Mar 03 2016 - 06:44:10 EST