SSD wear: how many flash bytes per client byte
In the book: Chapter 12, Chapter 25
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.
Per client byte
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.
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 decisionsrc/common/options/global.yaml.in :: bluestore_min_alloc_size_ssd (4 KiB), bluestore_prefer_deferred_size_ssd (0), bluestore_rocksdb_optionsThe SSD defaults and the RocksDB optionssrc/osd/ECUtil.h :: stripe_info_t; src/common/options/mon.yaml.in :: osd_pool_erasure_code_stripe_unitEC chunks and the stripe_unitsrc/os/bluestore/BlueFS.cc :: bytes_written_wal, bytes_written_sst; BlueStore.cc :: write_big_bytes, write_small_bytes, issued_deferred_write_bytesThe counters that show the real writes