Lxd containers, ZFS and snapshots

I have got a 50GB container on my non-ZFS LXD server. Creating a single LXD snapshot of this container takes about 70 (seventy) minutes on this rather old server. If I was to add a LXD ZFS storage pool and move the container onto that, would lxd snapshots be handled by ZFS and hence be almost instant or would I still be waiting 70 or so minutes because of qcow limitations, if that’s what lxd uses for ZFS backed containers?

When creating lxd snapshots of a non-ZFS backed container, how much does the performance of the container suffer with each snapshot added, if performance does degrade? If there is a performance penalty, Is there a recommended upper limit of snapshots that can be took of any one container before performance suffers too much for it to be be worthwhile?

ZFS should make this near instant.

Assuming your non-zfs means directory storage, then each snapshot is a full rsync of the container, which if it contains sparse files, can be extremely slow. The performance post-snapshot will not degrade as a snapshot on dir backend is just a copy of the entire container, there’s no copy on write or anything at play there, which also means they take up a lot of space.

ZFS snapshots don’t have any of those issues, they’re instant and will only use as much disk space as whatever changed later on.

1 Like