Date: Wed, 23 Jul 2014 08:45:36 +0100 From: Arthur Chance <freebsd@qeng-ho.org> To: Warren Block <wblock@wonkity.com>, RW <rwmaillists@googlemail.com> Cc: freebsd-questions@freebsd.org Subject: Re: How much swap space for a 32 GB RAM system? Message-ID: <53CF6820.7080103@qeng-ho.org> In-Reply-To: <alpine.BSF.2.11.1407222030230.28002@wonkity.com> References: <53CE8BB8.7030303@qeng-ho.org> <alpine.BSF.2.11.1407221018190.80885@wonkity.com> <20140722203928.6993a78d@gumby.homeunix.com> <alpine.BSF.2.11.1407222030230.28002@wonkity.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On 23/07/2014 03:32, Warren Block wrote: > On Tue, 22 Jul 2014, RW wrote: > >> On Tue, 22 Jul 2014 10:24:13 -0600 (MDT) >> Warren Block wrote: >> >>> On Tue, 22 Jul 2014, Arthur Chance wrote: >>> >>>> I'm getting a new machine with 32 GB of memory. The old "twice >>>> physical memory" sizing seems ridiculous, so how big should I make >>>> swap? Do I even need swap with this much memory? >>> >>> Technically, no, but the system does like to have at least a little >>> swap space and can benefit from it. (I forget where this is >>> explained, tuning(7) maybe.) >> >> This is something that is often repeated, but I don't recall every >> seeing an actual explanation. > > That's what I said, and then somebody pointed to the explanation. But > it was years ago, so now it's hard to remember exactly where it was. As it was me that asked the question I thought I'd better go and look at tuning(7). This says, amongst much else > The swap partition should typically be approximately 2x the size of main > memory for systems with less than 4GB of RAM, or approximately equal to > the size of main memory if you have more. Keep in mind future memory > expansion when sizing the swap partition. Configuring too little swap > can lead to inefficiencies in the VM page scanning code as well as create > issues later on if you add more memory to your machine. On larger sys‐ > tems with multiple SCSI disks (or multiple IDE disks operating on differ‐ > ent controllers), configure swap on each drive. The swap partitions on > the drives should be approximately the same size. The kernel can handle > arbitrary sizes but internal data structures scale to 4 times the largest > swap partition. Keeping the swap partitions near the same size will > allow the kernel to optimally stripe swap space across the N disks. Do > not worry about overdoing it a little, swap space is the saving grace of > UNIX and even if you do not normally use much swap, it can give you more > time to recover from a runaway program before being forced to reboot. Somehow this section feels like it was written a while back. (As do several other parts of the page.) The date on the man page is December 8th 2012, but there's a lot of information in there about sysctl tuning that's liable to have been edited after the swap sizing section.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?53CF6820.7080103>