From owner-freebsd-questions@FreeBSD.ORG Wed Jul 23 07:45:42 2014 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 02E962DE for ; Wed, 23 Jul 2014 07:45:42 +0000 (UTC) Received: from blue.qeng-ho.org (blue.qeng-ho.org [217.155.128.241]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 737EC2C27 for ; Wed, 23 Jul 2014 07:45:40 +0000 (UTC) Received: from fileserver.home.qeng-ho.org (localhost [127.0.0.1]) by fileserver.home.qeng-ho.org (8.14.7/8.14.5) with ESMTP id s6N7jaA6044920; Wed, 23 Jul 2014 08:45:37 +0100 (BST) (envelope-from freebsd@qeng-ho.org) Message-ID: <53CF6820.7080103@qeng-ho.org> Date: Wed, 23 Jul 2014 08:45:36 +0100 From: Arthur Chance User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Warren Block , RW Subject: Re: How much swap space for a 32 GB RAM system? References: <53CE8BB8.7030303@qeng-ho.org> <20140722203928.6993a78d@gumby.homeunix.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Cc: freebsd-questions@freebsd.org X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jul 2014 07:45:42 -0000 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.