Skip to main content
RunBook Academy

CephXVII · PoolsPools

Erasure-coded pools in production

Advanced⏱ ~17 minceph

What you'll learn

  • Explain the k+m model and compute its efficiency
  • Identify workloads suited to erasure coding
  • Configure an EC pool with an appropriate profile
  • Anticipate the operational differences from replication

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

Erasure coding is how a cluster stores a petabyte of archive without buying three petabytes of disk. It is also the wrong choice for VM disks, and the reasons are specific.

The model

An object is split into k data chunks and m parity chunks. Any k of the k+m chunks reconstruct the object.

k=4 m=2   6 chunks, tolerates 2 losses, 67% efficiency
k=8 m=3  11 chunks, tolerates 3 losses, 73% efficiency
k=2 m=2   4 chunks, tolerates 2 losses, 50% efficiency
size 3   (replication) tolerates 2 losses, 33% efficiency

Compare k=4 m=2 against size 3: the same two-failure tolerance at double the usable capacity.

ceph osd erasure-code-profile set ec42 \
    k=4 m=2 crush-failure-domain=host
ceph osd pool create rgw-data erasure ec42
ceph osd pool set rgw-data min_size 5
ceph osd pool application enable rgw-data rgw

The costs

Failure domains. k+m distinct buckets. k=8 m=3 needs eleven hosts, against three for size 3.

Write amplification for small writes. A partial write to an object requires reading existing chunks, recomputing parity, and writing back — a read-modify-write across several OSDs. Replication just writes.

Recovery cost. Reconstructing a lost chunk requires reading k chunks from k different OSDs. Replication copies one chunk from one OSD.

CPU. Parity computation on every write and every reconstruction.

Latency. Every operation touches k or k+m OSDs rather than size, so the slowest-member effect is worse.

Where EC belongs

Good: RGW data pools, backup and archive pools, CephFS bulk data, anything with large objects written once and read whole.

Poor: RBD for VMs, databases, CephFS metadata, RGW bucket indexes, anything with small random writes.

RBD on EC is supported and it performs poorly for the small-write reason above. Where it is used, it is for cold images rather than active VMs.

Verifying

ceph osd pool ls detail | grep erasure
ceph osd erasure-code-profile get ec42
ceph df                       # compare STORED and USED
ceph pg ls-by-pool rgw-data | head -3

Quiz

Knowledge check · 4 questions

  1. Q1. Why does Ceph default an erasure-coded pool min_size to k+1 rather than k?

  2. Q2. An erasure-coded pool takes longer to return to full redundancy after a failure than a replicated pool of the same size.

  3. Q3. A team wants to move a 200 TB RBD pool serving 150 VMs from size 3 to k=4 m=2 to reclaim capacity. Advise.

    150 active VMs with mixed workloads including several databases. Pool is 200 TB used on SSD OSDs across 12 hosts. Moving to k=4 m=2 would take usable capacity from 33% to 67% of raw, appearing to double available space. The team has confirmed 12 hosts satisfies the 6-chunk failure domain requirement.

  4. Q4. Compare k=4 m=2 against size 3 on tolerance, efficiency, and failure-domain requirement.

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

Production discipline

Match erasure coding to large-object, write-once, read-whole workloads — RGW data, archives, CephFS bulk — and keep small random writes on replication. Compute the failure-domain requirement of k+m before choosing a profile, since it cannot be changed afterwards without a pool migration. Keep min_size at k+1 and treat lowering it to k as a time-boxed emergency decision. And choose m with recovery duration in mind, not only simultaneous-failure tolerance.

Cross-course references

  • Ceph: Part XXV (Erasure Coding Fundamentals) for the mechanism.
  • Ceph: Part XXVI (Erasure Coding Trade-offs) for profile selection.
  • Ceph: Part XV (CRUSH Maps and Rules) for EC rules.