I posted another question about pros/cons of using compression for the main LXD dataset.
Here I’m wondering if there’s a way to launch a lxd container & configure compression during that launch so the container’s zfs dataset is configured with or without compression, depending on what I specify during the launch command.
So instead of the lxd container inheriting the compression setting for all containers from whatever mypool/lxd is configured with I could have containers without compression or other containers using different compression algorithms.
For example, something like:
lxc launch ubuntu:22.04 ubuntu22 compression=zstd
Would cause the zfs dataset for that container to be created with something like:
The workaround you mention seems it may be a good alternative. It was something I was thinking might work for this.
Generally, right now I’m just trying to determine whether to use none, lz4 or zstd on my lxd dataset so the containers that I’ll use for web hosting will inherit the setting. Being able to configure compression at lxd launch time would make that easier for comparing those options.
But I could also see it being beneficial at times to maybe being able to switch the zfs dataset compression used for containers. Maybe, for example, if someone needed to ease up on CPU usage or improve disk throughput, etc. Exporting the container & then importing it with the changed compression setting would make that process fairly easy.
The alternative you described seems it may also work well for this. I may test it out. Also I agree about zstd, I use that on my data pools but was unsure how much difference it may make for a webserver container.