CephLXIII · Capacity ManagementCapacity Management
The cost of erasure coding
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
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
| Profile | Raw multiplier | Usable | Tolerates | Comparable to |
|---|---|---|---|---|
k=2 m=1 | 1.50× | 67% | 1 | — |
k=4 m=2 | 1.50× | 67% | 2 | better than 2+1 |
k=6 m=3 | 1.50× | 67% | 3 | better again |
k=8 m=3 | 1.38× | 73% | 3 | — |
k=4 m=3 | 1.75× | 57% | 3 | — |
size=3 | 3.00× | 33% | 2 | replication 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
| Cost | Effect |
|---|---|
| Host count | k+m must fit the failure domain; 8+3 needs 11 hosts |
| Recovery amplification | reconstructing one chunk reads k chunks |
| Small object overhead | each object is split into k chunks, each padded |
| Partial write cost | read-modify-write for writes smaller than a stripe |
| CPU | encode on write, decode on degraded read |
| Latency | k+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
| Workload | Profile | Why |
|---|---|---|
| RGW archive, large objects | k=8 m=3 | best ratio; objects are large |
| RGW general purpose | k=4 m=2 | balance; tolerates 2 |
| CephFS bulk data | k=4 m=2 | with metadata on a replicated pool |
| RBD | k=4 m=2 with allow_ec_overwrites | acceptable; expect write cost |
| Small objects, high IOPS | replication | EC overhead exceeds its saving |
Quiz
Knowledge check · 4 questions
Q1. A k=4 m=2 pool shows USED/STORED of about 3.0 rather than 1.5. What is the likely cause?
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.
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.
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