From owner-freebsd-stable@FreeBSD.ORG Tue Dec 10 23:34:49 2013 Return-Path: Delivered-To: freebsd-stable@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 5EE53138 for ; Tue, 10 Dec 2013 23:34:49 +0000 (UTC) Received: from ns1.jnielsen.net (secure.freebsdsolutions.net [69.55.234.48]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 225101AB4 for ; Tue, 10 Dec 2013 23:34:48 +0000 (UTC) Received: from [10.10.1.198] (office.betterlinux.com [199.58.199.60]) (authenticated bits=0) by ns1.jnielsen.net (8.14.4/8.14.4) with ESMTP id rBANYcQs028872 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Tue, 10 Dec 2013 18:34:39 -0500 (EST) (envelope-from lists@jnielsen.net) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 7.0 \(1822\)) Subject: Re: Swap on ZFS - bad idea? (swap_pager: indefinite wait buffer) From: John Nielsen In-Reply-To: <52A78CB3.8050109@ShaneWare.Biz> Date: Tue, 10 Dec 2013 16:35:31 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <197090E6-DE73-40C2-8475-E102640B0DAF@jnielsen.net> References: <52A78CB3.8050109@ShaneWare.Biz> To: Shane Ambler X-Mailer: Apple Mail (2.1822) X-DCC-sonic.net-Metrics: ns1.jnielsen.net 1156; Body=4 Fuz1=4 Fuz2=4 X-Virus-Scanned: clamav-milter 0.97.8 at ns1.jnielsen.net X-Virus-Status: Clean Cc: Oscar Prieto , Benjamin Lutz , "freebsd-stable@freebsd.org Stable" X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2013 23:34:49 -0000 On Dec 10, 2013, at 2:50 PM, Shane Ambler wrote: > On 11/12/2013 04:06, Oscar Prieto wrote: >> Personally I still have to read an announcement telling that swap on = zfs is >> relliable. I'm still using a dedicated swap partition on every = install due >> to that kind of behaviour. >=20 >> On Tue, Dec 10, 2013 at 11:41 AM, Benjamin Lutz = wrote: >>=20 >>> This sort of hang seems to happen every couple of months. I'd really = like >>> some pointers on how to increase the stability of this system. Maybe = there >>> are some more tunables I need to adjust? Or is swap on ZFS maybe = just not >>> a great idea? >=20 > I did read somewhere that it is not recommended to use a zvol for = swap. >=20 > Personally I did setup swap on a zvol when I first started with zfs. > Turning it off showed a performance boost but I never had any errors > from it. I had only setup a single disk zpool so maybe its swap on zfs > raidz that causes the errors. I've never seen a problem with swap on a zvol in any currently-supported = version of FreeBSD but as always, YMMV. I use the below commands to = create and activate a swap volume (2G in this example): zfs create -V 2G -o org.freebsd:swap=3Don -o checksum=3Doff -o = compression=3Doff -o dedup=3Doff -o sync=3Ddisabled -o primarycache=3Dnone= ${rootzpool}/swap echo "/dev/zvol/${rootzpool}/swap none swap sw 0 0" >> /etc/fstab swapon -a Most of those options are from = https://wiki.freebsd.org/RootOnZFS#ZFS_Swap_Volume, other bits are from = elsewhere. Using both "org.freebsd:swap=3Don" and /etc/fstab is = redundant but doesn't hurt anything. HTH, JN