ZFS Compression

by Scott nolin — last modified Mar 19, 2014 03:11 PM


Important Note: The definitive source for Lustre documentation is the Lustre Operations Manual available at https://wiki.hpdd.intel.com/display/PUB/Documentation.

These documents are copied from internal SSEC working documentation that may be useful for some, but be we provide no guarantee of accuraccy, correctness, or safety. Use at your own risk.

Notes on enabling and working with zfs compression

We assume this is for zfs on lustre, but will work the same for standalone zfs. To do this on a lustre/zfs system, you have to perform these commands on every OST in the system. I would definitely not bother doing this on the metadata!


NOTE - here I'll assume you always work on a whole pool or filesystem, but these commands should work on any arbitrary directory too.


<STORAGE> = the pool, filesystem, or directory you choose.


Check ZFS compression

zfs get compression <STORAGE>

Set ZFS compression

zfs set compression=on <STORAGE>
turns on compression with default algorithm (lzjb). You can chose values other than "on" for the compression algorithm, see 'man zfs' for details.
To use a different algorithm (lz4 is probaby best now..), use "compression=lz4"
I think you might only need to set this on pools, and filesystems should inherit, but to be safe, you can apply it to everything.

Check compression ratio

zfs get compressratio <STORAGE>