Setting the compression ratio for the compression algorithm

There are two variables in the server configuration regarding the compression algorithm, namely backups.compression_algorithm and images.compression_algorithm. There is also a parameter for compression in some methods (e.g., lxc publish and lxc export). However, I do not find an option to specify the compression ratio. How can I set it?

I wonder if we allow arguments to be passed, did you try setting to say gzip -4 or something?

We’re unlikely to add a dedicated config key for this as it’d need LXD to understand the different compression level of each of the algorithms. But if we support just passing arguments directly, then that’d be easy.

Yes @stgraber, it works passing directly the arguments in the command. For instance:

lxc publish container --compression="gzip -4"
lxc publish container --compression="pigz -4"

I have not tried with settings. I am not sure if this solution also applies to settings because the documentation says that the options are bzip2, gzip, lzma, xz or none. I guess that gzip refers to the compression format, nor to a specific implementation (gzip or pigz).