Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 6 Jan 2011 10:14:00 -0500
From:      Jerry McAllister <jerrymc@msu.edu>
To:        Matthew Seaman <m.seaman@infracaninophile.co.uk>
Cc:        Jeff Whitman <JWhitman@JWNetSource.com>, freebsd-questions@freebsd.org
Subject:   Re: Swap Space
Message-ID:  <20110106151400.GA85633@gizmo.acns.msu.edu>
In-Reply-To: <4D258E8C.4020004@infracaninophile.co.uk>
References:  <009b01cbad28$883d31c0$98b79540$@com> <4D258E8C.4020004@infracaninophile.co.uk>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Jan 06, 2011 at 09:42:36AM +0000, Matthew Seaman wrote:

> On 05/01/2011 22:33, Jeff Whitman wrote:
> > I'm finding conflicting data on this.  Some say 0, some say 1 times RAM,
> > others say stay with 2 x RAM.
> 
> Standard advice is 2x RAM -- but that dates back to the days when
> servers would have quantities of RAM measured in Megabytes rather than
> Gigabytes.

Of course, in those days disk space was measured in MBytes too.
> 
>                             Also, there's a maximum of -- I think -- 8GB
> swap above which the performance of swap is degraded, due to algorithmic
> limits in the way memory pages are mapped onto disk pages.

I don't know about an 8GB limit for swap performance.  I suppose
it is possible.    So, the following formula from Mathew is probably 
a good new rule of thumb.

> 
> You need 1 x RAM + a few kB in order to support getting a crashdump. Or
> at least, you did before the days of minidumps.  Not sure what the
> requirements are for getting system dumps nowadays.  Swap space used for
> crashdumps should be a raw partition, not a file.

////jerry


> 
> On the other hand, for good performance you should not be using any
> significant amounts of swap in normal usage.  You will need some swap,
> as the OS tends to use a small amount even when not under memory
> pressure.  You should have swap to act as a buffer in case your machine
> suddenly starts using up more memory than you expect, either because of
> memory leaks, or due to demand spikes or through any number of other
> possible causes.
> 
> Therefore, I think the best advice for a modern large memory system
> would be:
> 
>     If RAM > 8GB, then SWAP = 8GB[*]
>     If RAM < 8GB, then SWAP = 1 x RAM + delta
> 
> where delta is perhaps a Megabyte or so.  Just rounding the partition
> size up to the next cylinder boundary should be enough (which happens
> automatically with most partitioning schemes).
> 
> 	Cheers,
> 
> 	Matthew
> 
> [*] In this case, if you need crashdumps, you should dedicate another
> otherwise unused partition of the correct size as your dumpdev.
> 
> -- 
> Dr Matthew J Seaman MA, D.Phil.                   7 Priory Courtyard
>                                                   Flat 3
> PGP: http://www.infracaninophile.co.uk/pgpkey     Ramsgate
> JID: matthew@infracaninophile.co.uk               Kent, CT11 9PW
> 





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20110106151400.GA85633>