Skip to main content
RunBook Academy

CephLXIII · Capacity ManagementCapacity Management

The cost of erasure coding

Advanced⏱ ~17 minceph

What you'll learn

  • Compute EC overhead for any profile
  • Compare profiles on capacity and durability
  • Identify costs the ratio does not show
  • Choose a profile for a given workload

Prerequisites

None — start here.

Verified against Ceph Tentacle 20.2.x · Ceph Squid 19.2.x (supported previous) · cephadm matches the verified Ceph release · podman 4.x · csi-rbd and csi-cephfs current · RBD / CephFS / RGW current (matches Ceph release) · Linux kernel 5.15+ (5.10 minimum) · Ubuntu 24.04 LTS (Ceph host baseline) · Debian 12 (Bookworm) (Ceph host baseline) · Rocky Linux / RHEL / AlmaLinux 9.x (Ceph host baseline) · Proxmox VE 9.x (cross-course integration) · Kubernetes 1.31+ (cross-course integration) · 2026-08-18

Not yet marked complete on this device.

Why this matters in production

EC’s headline is that it stores more data per disk. The ratio is easy to compute and the costs it omits are what determine whether a profile is right.

The arithmetic

raw per logical byte = (k + m) / k
usable fraction      = k / (k + m)
tolerates            = m failures
ProfileRaw multiplierUsableToleratesComparable to
k=2 m=11.50×67%1
k=4 m=21.50×67%2better than 2+1
k=6 m=31.50×67%3better again
k=8 m=31.38×73%3
k=4 m=31.75×57%3
size=33.00×33%2replication baseline
ceph osd erasure-code-profile get ec42
ceph osd pool get ec-pool erasure_code_profile
ceph df detail

Note the first three rows: the same 1.5× overhead buys one, two, or three failure tolerance depending on the profile. Larger k and m at the same ratio is strictly better on durability — and worse on everything else.

What the ratio does not show

CostEffect
Host countk+m must fit the failure domain; 8+3 needs 11 hosts
Recovery amplificationreconstructing one chunk reads k chunks
Small object overheadeach object is split into k chunks, each padded
Partial write costread-modify-write for writes smaller than a stripe
CPUencode on write, decode on degraded read
Latencyk+m OSDs must respond rather than size

The host count constraint is the one that most often rules out a profile: a 6-host cluster cannot run k=8 m=3 with failure_domain=host at all.

Small object overhead

object size 8 KiB, k=4, stripe unit 4 KiB
  → split into 4 chunks of 2 KiB each
  → padded to the stripe unit → 4 KiB each
  → 4 data + 2 parity = 6 × 4 KiB = 24 KiB raw for an 8 KiB object
  → effective multiplier 3×, not 1.5×
ceph df detail
# compare STORED against USED for the EC pool

If USED / STORED is much higher than (k+m)/k, small objects are the reason.

Choosing a profile

WorkloadProfileWhy
RGW archive, large objectsk=8 m=3best ratio; objects are large
RGW general purposek=4 m=2balance; tolerates 2
CephFS bulk datak=4 m=2with metadata on a replicated pool
RBDk=4 m=2 with allow_ec_overwritesacceptable; expect write cost
Small objects, high IOPSreplicationEC overhead exceeds its saving

Quiz

Knowledge check · 4 questions

  1. Q1. A k=4 m=2 pool shows USED/STORED of about 3.0 rather than 1.5. What is the likely cause?

  2. Q2. At the same 1.5x overhead, k=6 m=3 tolerates three failures where k=2 m=1 tolerates one, and pays for that in recovery amplification and write latency.

  3. Q3. Choose an EC profile for a new archive pool.

    A new RGW archive pool will store large objects, mostly written once and read rarely. The cluster has 9 hosts. The team proposes k=8 m=3 for its 1.38× ratio.

  4. Q4. Why is a wide EC profile wrong for a latency-sensitive workload?

Passing score: 75%. Answers are checked in this browser.

Production discipline

Verify an EC pool’s real overhead with USED / STORED in ceph df detail rather than the profile’s theoretical ratio; small objects padded to the stripe unit can push it to replication levels. Check that k+m fits the failure domain before choosing a profile — it cannot be changed after the pool exists.

Cross-course references

  • Kubernetes: quorum size versus tolerance is the same scaling trade-off
  • Linux: RAID6 versus RAID5 presents the analogous parity-count decision