Pcornel
Storage · Compression

LZ4

Cheat sheet · https://pcornel.dk/topic.php?topic=4307

Back to the Topic

Answer

LZ4 is a very fast lossless compression algorithm with modest ratios. It is the usual default in ZFS and many arrays because its CPU cost is low and it quickly gives up on incompressible data.

Remember

  • LZ4 is very fast with modest ratio.
  • It aborts early on incompressible data.
  • It is the usual ZFS default.

First checks

  • zfs set compression=lz4 <ds> — enable
  • lz4 -b <file> — benchmark
  • zfs get compressratio <ds> — result

Verify in this order

data → LZ4 → stored

Where it usually breaks

First mismatch in media/provider → controller/pool → logical object → path/protocol → filesystem/share/object namespace → consumer workload; preserve identity/pre-state before mutation.

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=4307

Confirmation

Confirm action

Continue?