From owner-freebsd-questions@FreeBSD.ORG Thu Jan 6 15:18:09 2011 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D3906106564A for ; Thu, 6 Jan 2011 15:18:09 +0000 (UTC) (envelope-from jerrymc@gizmo.acns.msu.edu) Received: from gizmo.acns.msu.edu (gizmo.acns.msu.edu [35.8.1.43]) by mx1.freebsd.org (Postfix) with ESMTP id 7E1FF8FC13 for ; Thu, 6 Jan 2011 15:18:09 +0000 (UTC) Received: from gizmo.acns.msu.edu (localhost [127.0.0.1]) by gizmo.acns.msu.edu (8.13.6/8.13.6) with ESMTP id p06FE1qf085724; Thu, 6 Jan 2011 10:14:01 -0500 (EST) (envelope-from jerrymc@gizmo.acns.msu.edu) Received: (from jerrymc@localhost) by gizmo.acns.msu.edu (8.13.6/8.13.6/Submit) id p06FE0uA085723; Thu, 6 Jan 2011 10:14:00 -0500 (EST) (envelope-from jerrymc) Date: Thu, 6 Jan 2011 10:14:00 -0500 From: Jerry McAllister To: Matthew Seaman Message-ID: <20110106151400.GA85633@gizmo.acns.msu.edu> References: <009b01cbad28$883d31c0$98b79540$@com> <4D258E8C.4020004@infracaninophile.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4D258E8C.4020004@infracaninophile.co.uk> User-Agent: Mutt/1.4.2.2i Cc: Jeff Whitman , freebsd-questions@freebsd.org Subject: Re: Swap Space X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Jan 2011 15:18:09 -0000 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 >