Pcornel
Browse topics
Options
Recent
Favorites
Storage · Technical reference

Compression Ratio

Direct answer

Compression ratio is original size divided by compressed size, for example 2:1 means data takes half the space. Check it per dataset or volume (zfs get compressratio) to see where compression pays off.

When to use this

Use this when measuring how much compression actually saves.

First 30 seconds

1. Compression ratio = uncompressed / compressed.

2. Text/logs high; media/encrypted about 1.0.

3. Plan capacity with measured ratios.

4. Ratios vary per dataset.

5. Report per workload.

Operational verification

logical ÷ physical → ratio

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 when measuring how much compression actually saves.
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
  • Comparing ratios across different tools.
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
  • 2:1 means data uses half the space.
  • Ratio varies by dataset.
  • Measure on real data.
Key checks
  • zfs get compressratio,logicalused,used <ds> — ratio
  • compsize <path> — Btrfs
  • array report — compression ratio
ReferenceHow it works1 section · depth on demand

Reference

zfs get used,logicalused,compressratio tank/data
ReferenceImportant terms & boundaries4 sections · depth on demand

In depth

Compression ratio: logical size divided by physical size

Compression ratio = logical (uncompressed) data ÷ physical space used. A 2.0× ratio means data takes half the space.

Reading it in ZFS

zfsprops(7) describes compressratio as the compression achieved for a dataset's used space (for snapshots, the same as refcompressratio). It also explains that blocks are allocated in whole sectors, so a block whose compression saves less than one sector is stored uncompressed. Zero-filled blocks are stored as holes when compression is on.

# zfs get -o name,property,value compressratio,refcompressratio,logicalused,used tank/data
NAME       PROPERTY          VALUE
tank/data  compressratio     1.74x
tank/data  refcompressratio  1.69x
tank/data  logicalused       2.61T
tank/data  used              1.50T

Ratio versus savings

RatioSpace saved
1.25×20 %
1.5×33 %
2.0×50 %
3.0×67 %

Typical ratios by content (rough)

DataUsual range
Text, logs, source code, JSON2–5×
Databases1.5–3×
VM images (OS and apps)1.3–2×
JPEG, MP4, ZIP, encrypted data~1.0×

Pitfalls when reporting

  • Large sector sizes (ashift=12, 4 KiB) limit savings for small blocks, because compressed data still rounds up to whole sectors.
  • Vendors often report "data reduction" as compression, dedup and thin provisioning combined. Ask for each figure separately.
  • The ratio applies only to data written since compression was enabled. Old data keeps its original form until rewritten.

Documented example, not captured output.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

How it works

The ratio is uncompressed size ÷ compressed size, reported per volume or dataset. It changes with the data written, so trend it over time.

Reference

Ratio = logical size ÷ compressed size. Check with zfs get compressratio, compsize /data (Btrfs) or array reports. Typical: databases 1.5–3×, logs 5×+, media ~1×.

Worked example

Example: zfs get used,logicalused,compressratio tank/logs → logicalused 300G, used 60G, ratio 5.00x. The pool stores 60 GB on disk for 300 GB of logical data.

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 Ratio. 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?