Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 10 Dec 2013 16:35:31 -0700
From:      John Nielsen <lists@jnielsen.net>
To:        Shane Ambler <FreeBSD@ShaneWare.Biz>
Cc:        Oscar Prieto <oscarmpp@gmail.com>, Benjamin Lutz <benjamin.lutz@biolab.ch>, "freebsd-stable@freebsd.org Stable" <freebsd-stable@freebsd.org>
Subject:   Re: Swap on ZFS - bad idea? (swap_pager: indefinite wait buffer)
Message-ID:  <197090E6-DE73-40C2-8475-E102640B0DAF@jnielsen.net>
In-Reply-To: <52A78CB3.8050109@ShaneWare.Biz>
References:  <OFB3F5370B.79D00F5F-ONC1257C3D.0038AB15-C1257C3D.003AB574@biotronik.com> <CAK9wqRrug7G5w3HyT7WiLitS8LJ-E1vYUNsD0X0EjkYfxcqgoQ@mail.gmail.com> <52A78CB3.8050109@ShaneWare.Biz>

next in thread | previous in thread | raw e-mail | index | archive | help
On Dec 10, 2013, at 2:50 PM, Shane Ambler <FreeBSD@ShaneWare.Biz> 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 =
<benjamin.lutz@biolab.ch>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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?197090E6-DE73-40C2-8475-E102640B0DAF>