ZFS ram requirements

G’day,

I was just wondering what your experiences are like with ZFS in low ram environments?

I need to run the nextcloud snap on a machine with 12GB of ram. I ideally would like to run this on a Ubuntu host with a Ubuntu VM stored on a ZFS pool. I don’t care about the safety of my data at all and it will be on a single 500GB ssd however it would be nice to rollback after a dodgy update. Is 12GB enough?

Cheers

My NAS at home has 8GB and runs just ZFS just fine.

The thing that more RAM gets you is a bigger ARC (in-memory caching), which is great for performance.

More than fine - I’m running several boxes with much more drive space than that and only 8G of RAM. If the OS needs more RAM you can tune down zfs a bit, but just go for it

12GiB is plenty, and that’s the way I’d choose to run NextCloud also (in a VM which is stored on an OpenZFS backing).

Allocate 4GiB to your NextCloud VM, and consider 6GiB of your RAM “allocated” to OpenZFS (it isn’t, exactly, but the ARC is limited by default to max out at half the system’s physical RAM, and I recommend both leaving it that way and considering it essentially dedicated that way).

This gives you half the physical RAM for ARC, 4GiB for the VM, and 2GiB left over for anything else that’s happening directly on the host. Easy peasy. And if you run short on RAM at some point… you probably want to steal 2GiB from the VM, and leave the ARC alone.

Agree with all of the above. Just wanted to add an observation from a very low RAM system.

I have a few long-running VMs that I use to test ZFS replication. On a FreeBSD 13 VM with 1 or 2 GB of RAM, things generally worked, but as data and snapshots accumulated, my zfs send process would start to get killed.

After I added some swap space, the jobs finished, and the system would only dip a toe into the swap. Even with 1 GB of RAM, replication used all the available RAM plus maybe 50-100 MB of swap, but no more.

I don’t know whether it’s possible to tell ZFS “there’s no swap, so don’t push it, buddy,” and I’ve only seen this happen on dinky FreeBSD VMs with almost no RAM… But I thought it was interesting that the process seemed to be capable of backing off after hitting the swap, but not before getting killed when there is no swap.

1 Like