CephLXIII · Capacity ManagementCapacity Management
Monitoring capacity
What you'll learn
- Read the capacity commands correctly
- Identify the metrics worth exporting
- Build alerts that give useful lead time
- Avoid alerts that fire too late
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
Capacity is the one problem with a reliable warning period, and the warning is only useful if the alert fires while the remedy — usually procurement — still fits in the time remaining.
The commands
ceph df # pool-level, with MAX AVAIL
ceph df detail # adds compression and quota columns
ceph osd df # per-OSD, with the utilisation column
ceph osd df tree # per-OSD grouped by host
ceph osd pool autoscale-status
# the three numbers that matter
ceph df | awk '/POOLS/,0' | awk 'NR>2 {print $1, $(NF)}' # MAX AVAIL per pool
ceph osd df | sort -k17 -rn | head -1 # fullest OSD
ceph osd df | awk 'NR>1 {n++; s+=$17} END {print s/n}' # average
The metrics
ceph mgr module enable prometheus
curl -s localhost:9283/metrics | grep -E '^ceph_(cluster|pool|osd).*bytes'
| Metric | Use |
|---|---|
ceph_cluster_total_bytes | raw capacity |
ceph_cluster_total_used_raw_bytes | raw used |
ceph_pool_stored | logical bytes per pool |
ceph_pool_max_avail | what the pool can still accept |
ceph_osd_stat_bytes_used | per-OSD used |
ceph_osd_stat_bytes | per-OSD capacity |
The per-OSD pair is what gives the fullest-OSD figure:
max(ceph_osd_stat_bytes_used / ceph_osd_stat_bytes)
Alerts with useful lead time
An alert at 85% on a cluster growing 1% per week gives ten weeks. The same alert on a cluster growing 5% per week gives two — less than most procurement cycles.
The alert that scales is a projection:
predict_linear(ceph_pool_max_avail[14d], 86400 * 60) < 0
“This pool will be full within 60 days at the current rate.” That fires with the same lead time regardless of growth rate.
| Alert | Threshold | Lead time |
|---|---|---|
| Fullest OSD utilisation | > 0.80 | varies with growth |
| Pool projected full | within 60 days | constant |
MAX AVAIL below one host’s data | any | the absorption check |
| Nearfull health check | fires at 0.85 | short |
| OSD utilisation spread | > 20 points | balance opportunity |
Alerts that fire too late
| Alert | Problem |
|---|---|
HEALTH_ERR on full | the cluster is already unwritable |
| Cluster average > 90% | the fullest OSD passed nearfull long before |
| Nearfull only | 10 points of margin is days on a busy cluster |
Quiz
Knowledge check · 4 questions
Q1. Why is a projection alert preferable to a fixed utilisation threshold?
Q2. A rebalance that writes no new client data can still change a pool's `ceph_pool_max_avail`.
Q3. Design capacity alerting for a fast-growing cluster.
A cluster is growing 4% of capacity per week. The only capacity alert is the Ceph nearfull health check at 85%. Procurement lead time is six weeks.
Q4. Which three figures give the clearest picture of cluster capacity?
Passing score: 75%. Answers are checked in this browser.
Production discipline
Alert on predict_linear over ceph_pool_max_avail with a horizon
longer than the procurement lead time; a fixed threshold gives less warning
precisely when the cluster is filling fastest. Track the fullest OSD and
the utilisation spread alongside it — the spread is capacity a rebalance
can recover without hardware.
Cross-course references
- Kubernetes: PVC capacity projection alerts follow the same pattern
- Linux: disk-fill prediction beats fixed percentage thresholds for the same reason