CephLX · Recovery TuningRecovery Tuning
The backfill settings and their interaction
What you'll learn
- State what each backfill setting controls
- Understand how the scan settings affect throughput
- Order changes by effect size
- Recognise when a setting is not the bottleneck
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
Backfill has more settings than recovery and they interact. Changing them in the wrong order produces no effect and wastes a maintenance window.
The settings
ceph config get osd osd_max_backfills
ceph config get osd osd_backfill_scan_min
ceph config get osd osd_backfill_scan_max
ceph config get osd osd_backfill_retry_interval
ceph config get osd osd_min_recovery_priority
| Setting | Effect | Typical change |
|---|---|---|
osd_max_backfills | concurrent backfills per OSD | 1 to 8 |
osd_backfill_scan_min | minimum objects per scan pass | rarely |
osd_backfill_scan_max | maximum objects per scan pass | rarely |
osd_backfill_retry_interval | delay after a rejected backfill | rarely |
osd_recovery_sleep_* | delay between operations | 0 to 0.1 |
Why the scan settings exist
Backfill proceeds by scanning ranges of the PG’s object namespace and comparing the primary’s contents with the destination’s. Larger scan ranges mean fewer round trips and higher throughput; they also mean each scan holds locks longer and produces a larger burst.
ceph config set osd osd_backfill_scan_max 1024 # default is smaller
This helps on clusters with very many small objects, where the round-trip cost dominates. It rarely helps elsewhere, which is why it is not the first thing to change.
Order of changes by effect size
# 1. the profile, if mClock is active
ceph config set osd osd_mclock_profile high_recovery_ops
# 2. concurrency
ceph config set osd osd_max_backfills 4
# 3. the sleep, if non-zero
ceph config set osd osd_recovery_sleep_hdd 0
# 4. scan ranges, only for small-object workloads
ceph config set osd osd_backfill_scan_max 1024
Change one at a time and measure between changes; changing several together means the effect cannot be attributed.
When the setting is not the bottleneck
# a full destination
ceph health detail | grep -i toofull
# a saturated network
ceph osd perf | sort -k3 -rn | head
# a single slow OSD limiting every PG it holds
ceph osd perf | sort -k2 -n | tail -5
# operations blocked
ceph -s | grep -i 'slow ops'
If any of these is present, raising a throttle changes nothing because the limit is elsewhere.
Quiz
Knowledge check · 4 questions
Q1. On which workload does raising `osd_backfill_scan_max` actually help?
Q2. Applying several backfill setting changes at once is efficient because it saves measurement time.
Q3. A throttle increase produces no improvement.
osd_max_backfills was raised from 1 to 6 during a maintenance window. The backfill rate is unchanged after thirty minutes.
Q4. What is the correct order for applying backfill tuning changes, and why?
Passing score: 75%. Answers are checked in this browser.
Production discipline
Change one backfill setting at a time and measure for fifteen
minutes between changes; simultaneous changes give a result with no
attribution. Before raising a throttle again, confirm it is the binding
constraint — check backfill_toofull, ceph osd perf outliers, and slow
ops.
Cross-course references
- Kubernetes: changing several resource settings at once makes regressions unattributable
- Linux: single-variable changes are the basis of any credible performance work