Swap on ZFS

krad kraduk at gmail.com
Fri Oct 8 10:06:01 UTC 2010


On 7 October 2010 21:20, Anselm Strauss <amsibamsi at gmail.com> wrote:

> On 10/02/10 17:52, Adam Vande More wrote:
> > On Sat, Oct 2, 2010 at 4:30 AM, Anselm Strauss <amsibamsi at gmail.com>
> wrote:
> >
> >> Hi
> >>
> >> I have a virtual server with only 512 MB of memory but still want to run
> >> ZFS on it.
> >> <snip>
> >> Has there been any fix or workaround for this? I guess it does not help
> >> when I use a swap file on ZFS instead of a separate zvol.
> >>
> >
> > Make sure you are following this:
> > http://wiki.freebsd.org/RootOnZFS/GPTZFSBoot  Please note swap is not a
> > ZVOL, it is a sepate partition.  You'd have the same problem with ZVOL.
> > Also use i386, that will save you a bit of memory.  Follow the ZFS tuning
> > guide.  Even if you follow all those things, I'm not sure you'll be able
> to
> > get it stable.  512MB is really tight.
> >
>
> I now have the swap on a separate disk and it seems more stable.
> Although the server still has only 512 MB of RAM, runs on amd64 and I
> did no tuning. It's not a file server but compiling ports and running
> some services seems okay.
>
> I have seen multiple posts on the net where people put swap on ZFS. What
> sense does it make when every time the machine runs out of physical
> memory it freezes before it can allocate some swap memory. Does it only
> make sense in case you have additional non-ZFS swap?
> _______________________________________________
> freebsd-questions at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "
> freebsd-questions-unsubscribe at freebsd.org"
>


there must be some logic in is as when you build a (open)*solaris box on
zfs, the swap is on a vdev by defaukt. I think its because ZFS runs in
kernel memory and this isn't swapable. Please correct me if im wrong
somebody.


$ swap -lh
swapfile             dev    swaplo   blocks     free
/dev/zvol/dsk/rpool/swap 182,2        4K     2.0G     2.0G
$ uname -a
SunOS desktop2 5.11 snv_134 i86pc i386 i86pc Solaris


More information about the freebsd-questions mailing list