FreeBSD 9.1 and swap on zfs

Kai Gallasch gallasch at free.de
Tue Apr 9 12:15:15 UTC 2013


Am 08.04.2013 um 15:53 schrieb Guido Falsi:
> On 04/08/13 15:08, Kai Gallasch wrote:
>> Hi.
>> 
>> When running a ZFS on root FreeBSD install..
>> 
>> is it for FreeBSD 9.1 (ZFS v28) still not advisable to use a vdev as swapspace? - like:

> I can share my experience, which is not definitive but I hope can help.

thank you!

> I have various machines with ZFS on root. some with swap on ZVOL and some with swap on separate partitions (none are mirroring the swap using gmirror though).
> 
> There is a race condition between ZFS' ARC and the VM system when very low memory conditions arise and this could happen and the machine just starves, I've seen this happen on machines when running buildworld -j without enough ram and also on machines running ports tinderbox or poudriere. This is not happening when using a separate swap partition. In such a case the machine swaps happily and just slows down as naturally expected when swapping a lot.

Do you also have machines running on 9.1 that swap on ZVOL and which show this behaviour?

> My suggestion is:
> 
> if you want stability and don't have specific disk layout problems create a separate swap.


I think I'll repartition and swap to a gmirror device then.
This also has the advantage of being able to write kernel dumps to the swap (not possible with a ZVOL bases swap AFAIK)

Kai.


More information about the freebsd-fs mailing list