Swap on ZFS

Daniel Staal DStaal at usa.net
Tue May 6 23:08:43 UTC 2014

--As of May 6, 2014 2:21:43 PM -0500, David Noel is alleged to have said:

> Is swap on ZFS still ill-advised? All the forum, list, and blog posts
> I find say it's a no-go. Is this still the case? The idea behind it
> not working is that ZFS needs memory to write to disk, so when you
> need to swap (are low on memory) ZFS won't be able to write.
> I found some talk of having a tunable added as a workaround that would
> reserve a certain amount of memory for ZFS so this wouldn't be a
> problem, but have no idea if anyone's made any progress towards
> implementing it.

--As for the rest, it is mine.

I haven't seen anything official, and it hasn't been that long (a couple of 
months - I don't think I've seen any major updates since that didn't have 
to do with OpenSSL) since I had a problem that locked up my machine for a 
day before I could fix it and give it some *other* swap, so I'll say: Yes.

That said, if you don't use swap heavily it works: I didn't have trouble 
for several years before I started adding to the box's load and ran it out 
of RAM.  Just make sure you have enough RAM to cover all normal 
requirements, and that extreme cases aren't very common or very extreme. 
Otherwise, give it a small dedicated swap drive/partition.  (I put it on 
the same drive the ZIL - the ZIL will have a max defined size dependent on 
your RAM, so there was plenty of space on the SSD that would never be used.)

Daniel T. Staal

This email copyright the author.  Unless otherwise noted, you
are expressly allowed to retransmit, quote, or otherwise use
the contents for non-commercial purposes.  This copyright will
expire 5 years after the author's death, or in 30 years,
whichever is longer, unless such a period is in excess of
local copyright law.

More information about the freebsd-questions mailing list