Pcornel
Browse topics
Options
Recent
Favorites
Storage · Technical reference

Compression Fundamentals

Direct answer

Compression replaces repeated patterns in data with shorter codes. Storage systems use lossless algorithms, and the saving depends on the data: text, logs and databases compress well, media and encrypted data do not.

When to use this

Use this to understand what compression can and cannot save on storage.

First 30 seconds

1. Compression trades CPU for space and I/O.

2. Algorithms: LZ4 (fast), ZSTD (tunable), gzip (slow).

3. Applies to new writes.

4. Check ratio per dataset.

5. Avoid double compression.

Operational verification

data → compression algorithm → stored

Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
Storage architecture and operations
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

PlatformStorage architecture and operations
Scope / prerequisiteUse this to understand what compression can and cannot save on storage.
What next?3 suggested next steps
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

1 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 Common mistakes Narrow the fault
  • Expecting savings on encrypted data.
Evidence references

Evidence · 1 on this Topic

Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.

observation · 1
Key points
  • Text, logs and databases compress well.
  • Media, archives and encrypted data do not.
  • Lossless compression returns data exactly.
Key checks
  • zfs get compression,compressratio <ds> — ZFS
  • compsize <path> — Btrfs actual
  • gzip -l <file> — file ratio
ReferenceHow it works1 section · depth on demand

Reference

DataTypical ratio
Text/logs4–10×
Databases1.5–3×
VM disks1.3–2×
Media/archives~1×
ReferenceImportant terms & boundaries2 sections · depth on demand

How it works

Lossless compression finds repeated patterns and encodes them more compactly. Text and logs compress well; already compressed or encrypted data does not.

Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor docStorage architecture and operations current

Authoritative/upstream documentation reviewed for bounded claims in Compression → Compression Fundamentals. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://openzfs.github.io/openzfs-docs/man/master/7/zfsprops.7.html · confidence 94%
Confirmation

Confirm action

Continue?