The Comprehensive Ceph Guide
فارسیGet started

SSD wear: how many flash bytes per client byte

In the book: Chapter 12, Chapter 25

Lab

SSD wear: how many flash bytes per client byte

Give the write load, IO size, pool type and SSD specs, and see how replication or EC, rounding to min_alloc_size, deferred writes and RocksDB metadata with compaction turn each client byte into several flash bytes, and roughly how many years each OSD lasts.

5.51×flash bytes per client byte
7938 GBdaily writes per OSD
2.067DWPD used per OSD
2.4 / 2.2approximate life (years): average / busiest

Per client byte

Replicas or chunks
3×
Metadata: WAL and flush
0.38×
Metadata: compaction
1.88×
Recovery and rebalance
0.26×
5yosd.0: 2.7 y0osd.1: 2.7 y1osd.2: 2.6 y2osd.3: 2.6 y3osd.4: 2.6 y4osd.5: 2.6 y5osd.6: 2.5 y6osd.7: 2.5 y7osd.8: 2.5 y8osd.9: 2.5 y9osd.10: 2.5 y10osd.11: 2.4 y11osd.12: 2.4 y12osd.13: 2.4 y13osd.14: 2.4 y14osd.15: 2.3 y15osd.16: 2.3 y16osd.17: 2.3 y17osd.18: 2.3 y18osd.19: 2.3 y19osd.20: 2.3 y20osd.21: 2.2 y21osd.22: 2.2 y22osd.23: 2.2 y23
Approximate life of 24 OSDs, from the least to the most busy; the dashed line is the warranty. Red: worn out before the warranty ends.

The busiest OSD lasts about 2.2 years, less than the 5-year warranty. A higher-DWPD SSD, more OSDs, larger IO or a better balance (the upmap balancer) helps.

per OSD write = io = 16384 B → roundup(·, min_alloc_size) · RocksDB WA ≈ 12
TBW = DWPD × capacity × 365 × years · life = TBW / (TB written per day × 365)
ceph daemon osd.0 perf dump bluefs        # bytes_written_wal, bytes_written_sst
ceph daemon osd.0 perf dump bluestore     # write_big_bytes, write_small_bytes, issued_deferred_write_bytes
smartctl -a /dev/nvme0n1 | grep -i -e "percentage used" -e "data units written"

Small writes cost the most, because the metadata of each write is multiplied by compaction; for pools full of small IO buy high-DWPD SSDs. Read the real numbers from the bluefs counters (chapter 25) and SMART's Percentage Used, and tune the model to them.

Follows:

  • src/os/bluestore/BlueStore.cc :: _do_write_small, _do_write_big (padding to min_alloc_size, deferred below prefer_deferred_size) Rounding to min_alloc_size and the deferred decision
  • src/common/options/global.yaml.in :: bluestore_min_alloc_size_ssd (4 KiB), bluestore_prefer_deferred_size_ssd (0), bluestore_rocksdb_options The SSD defaults and the RocksDB options
  • src/osd/ECUtil.h :: stripe_info_t; src/common/options/mon.yaml.in :: osd_pool_erasure_code_stripe_unit EC chunks and the stripe_unit
  • src/os/bluestore/BlueFS.cc :: bytes_written_wal, bytes_written_sst; BlueStore.cc :: write_big_bytes, write_small_bytes, issued_deferred_write_bytes The counters that show the real writes
A fixed snapshot of the simulator; the interactive version is in the web edition's lab. Interactive lab: SSD wear: how many flash bytes per client byte