| your Linux construction kit
Source
← Back to ZFS Overview

Compression & Deduplication — one is your friend, the other is a trap.

Compression: always enable it

There is almost no reason to leave compression off. LZ4 compression adds near-zero CPU overhead and typically gives 1.5-2x space savings. It actually improves performance in many cases because the system reads and writes fewer bytes to disk.

lz4
Default. Use this. Near-zero CPU overhead. Good compression ratio. Best for 99% of workloads.
zstd
Better compression ratio than LZ4, slightly more CPU. Great for media, archives, and cold storage.
gzip
Best compression ratio, highest CPU cost. Only for archival data where CPU usage doesn't matter.
off
Only disable for already-compressed data (encrypted volumes, compressed media) where compression wastes CPU with no benefit.

Deduplication: don't

Deduplication requires 1-2GB of RAM per TB of deduplicated data.

10TB of storage with dedup enabled needs 10-20GB of RAM just for the dedup table. The table must fit in memory for acceptable performance. If it doesn't, performance collapses as ZFS constantly reads the table from disk.

Dedup sounds great: "Why store the same block twice?" In practice, most data isn't that redundant. The RAM cost is always there. The space savings rarely justify it. Use compression instead — it gives real savings with near-zero cost.

The only valid use case: identical VM images or backup sets with extreme redundancy where the data is truly, provably, block-level identical. Even then, ZFS clones are usually better.