Skip to main content
RunBook Academy

CephLXIII · Capacity ManagementCapacity Management

Monitoring capacity

Intermediate⏱ ~17 mincephprometheus

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

Not yet marked complete on this device.

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'
MetricUse
ceph_cluster_total_bytesraw capacity
ceph_cluster_total_used_raw_bytesraw used
ceph_pool_storedlogical bytes per pool
ceph_pool_max_availwhat the pool can still accept
ceph_osd_stat_bytes_usedper-OSD used
ceph_osd_stat_bytesper-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.

AlertThresholdLead time
Fullest OSD utilisation> 0.80varies with growth
Pool projected fullwithin 60 daysconstant
MAX AVAIL below one host’s dataanythe absorption check
Nearfull health checkfires at 0.85short
OSD utilisation spread> 20 pointsbalance opportunity

Alerts that fire too late

AlertProblem
HEALTH_ERR on fullthe cluster is already unwritable
Cluster average > 90%the fullest OSD passed nearfull long before
Nearfull only10 points of margin is days on a busy cluster

Quiz

Knowledge check · 4 questions

  1. Q1. Why is a projection alert preferable to a fixed utilisation threshold?

  2. Q2. A rebalance that writes no new client data can still change a pool's `ceph_pool_max_avail`.

  3. 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.

  4. 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