The Comprehensive Ceph Guide
فارسیGet started

Capacity and full-ratio planner

In the book: Chapter 7

Lab

Capacity and full-ratio planner

Give hosts, OSDs, the pool type and the data stored: see MAX AVAIL, which OSD sets that limit, and which OSDs a lost host pushes past nearfull, backfillfull and full.

72 TiBraw capacity in service
72 TiBraw space used
0 TiBMAX AVAIL of this pool
100.0%fullest OSD
osd.0 (host1): down/out0osd.1 (host1): down/out1osd.2 (host1): down/out2osd.3 (host2): 100% · failsafe▼3osd.4 (host2): 100% · failsafe4osd.5 (host2): 100% · failsafe5osd.6 (host3): 100% · failsafe6osd.7 (host3): 100% · failsafe7osd.8 (host3): 100% · failsafe8osd.9 (host4): 100% · failsafe9osd.10 (host4): 100% · failsafe10osd.11 (host4): 100% · failsafe1185%90%95%
Fill of each OSD (bars) against nearfull, backfillfull and full (lines). Green: normal; amber: nearfull; orange: backfillfull; red: full; grey: the lost host. ▼ marks the OSD that sets MAX AVAIL.
  • HEALTH_ERR OSD_FULL: 9 full OSD(s); writes to their pools stop
MAX AVAIL = min over OSDs ( (kb_avail − kb × (1 − full_ratio)) × 1024 / wi ) / raw_used_rate, wi = crush_weighti / Σ crush_weight · raw_used_rate = 3
OSD state: ratio > failsafe → FAILSAFE · > full → FULL · > backfillfull → BACKFILLFULL · > nearfull → NEARFULL

MAX AVAIL comes from the OSD that is fullest for its weight, not from the average. One unbalanced OSD, or one bigger OSD in a small host, limits the whole pool; the balancer (chapter 8) and OSDs of equal size help most.

Follows:

  • src/mon/PGMap.cc :: get_rule_avail, dump_object_stat_sum (max_avail = avail / raw_used_rate) the smallest writable space divided by the weight share
  • src/crush/CrushWrapper.cc :: get_rule_weight_osd_map, _get_take_weight_osd_map, _normalize_weight_map the float weight of each OSD under the rule's take
  • src/osd/OSD.cc :: OSDService::recalc_full_state the order of the failsafe, full, backfillfull and nearfull checks
  • src/osd/OSDMap.cc :: check_health (OSD_NEARFULL, OSD_BACKFILLFULL, OSD_FULL), pool_raw_used_rate the health check names and raw_used_rate
  • src/common/options/global.yaml.in :: mon_osd_nearfull_ratio (0.85), mon_osd_backfillfull_ratio (0.90), mon_osd_full_ratio (0.95), osd_failsafe_full_ratio (0.97) the default ratios
A fixed snapshot of the simulator; the interactive version is in the web edition's lab. Interactive lab: Capacity and full-ratio planner