Skip to main content
RunBook Academy

CephLVIII · RecoveryRecovery

How recovery affects client I/O

Advanced⏱ ~17 minceph

What you'll learn

  • Explain the mechanism of recovery interference
  • Measure client impact during recovery
  • Set an acceptable impact level
  • Balance recovery speed against client latency

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

Recovery competes with clients for exactly the same resources, so the question is never whether to accept impact but how much. Making that an explicit decision rather than a default is what keeps a recovery from becoming an incident.

The mechanism

Recovery and client I/O share:

ResourceContention
OSD devicereads on the source, writes on the destination
Cluster networkrecovery traffic alongside replication
OSD CPUencode and decode on EC, general processing
OSD queuesoperations waiting behind each other

The queue contention is the one that produces latency: a client operation arriving behind several recovery operations waits for them.

Measuring the impact

# baseline, before or between recoveries
ceph osd pool stats rbd-vms
rbd perf image iostat --pool rbd-vms

# during recovery
ceph -s | grep -E 'client|recovery'
ceph osd perf | sort -k2 -n | tail
# the ratio worth watching
ceph -s | grep -E 'client:|recovery:'
# client:   142 MiB/s rd, 88 MiB/s wr, 6.05k op/s
# recovery: 412 MiB/s, 103 objects/s

Recovery consuming several times the client bandwidth means clients are getting a fraction of the cluster.

Setting an acceptable level

The decision should be stated in the units clients experience:

acceptable: p99 write latency below 20 ms during recovery
target:     recovery completes within 12 hours

Both constraints together determine the throttle setting, and they may conflict — in which case one must give and the choice should be explicit.

ceph config set osd osd_mclock_profile high_client_ops   # favour clients
ceph config set osd osd_mclock_profile high_recovery_ops # favour recovery

The reasoning behind the default

Ceph defaults to favouring client I/O because redundancy above min_size means the cluster is safe while it recovers. That is correct while two copies remain and wrong once a PG is at one, which is why the decision should account for the actual exposure:

ExposurePriority
size 3, two copies remainclients
size 3, one copy remains on some PGsrecovery
Failure probability elevated (bad batch)recovery
Recovery window measured in daysrecovery

Quiz

Knowledge check · 4 questions

  1. Q1. What primarily drives the client latency increase during recovery?

  2. Q2. Ceph's default is to favour recovery speed over client latency.

  3. Q3. Set recovery priority appropriately for the exposure.

    A size-3 pool has 40 PGs down to a single copy after two OSD failures. Recovery is running under the default profile and client latency is normal. The projected completion is 18 hours.

  4. Q4. Why should the acceptable client impact be recorded before a recovery rather than decided during one?

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

Production discipline

Record the acceptable client latency and recovery window in the runbook so the throttle decision is a lookup rather than a judgment made under pressure. Invert the default priority when PGs are at a single copy — the reasoning behind favouring clients does not apply at that exposure.

Cross-course references

  • Kubernetes: priority classes ordering competing work is the same trade made explicit
  • Linux: ionice for background maintenance addresses the identical contention