The Comprehensive Ceph Guide
فارسیGet started

Real space in BlueStore: min_alloc_size, padding and compression

In the book: Chapter 12

Lab

Real space in BlueStore: min_alloc_size, padding and compression

Change the object size, the pool type and min_alloc_size and see how much raw disk a small object really takes; then watch BlueStore's compression acceptance test on one blob.

384×raw ÷ logical
1.5×the pool's nominal ratio
366.21 GiBraw space for 1,000,000 objects
976.56 MiBlogical data

One object's shards or replicas

D0
4 KiB → 64 KiB
D1
4 KiB → 64 KiB
D2
4 KiB → 64 KiB
D3
4 KiB → 64 KiB
P4
4 KiB → 64 KiB
P5
4 KiB → 64 KiB

Solid: data (blue) or parity (purple) · red hatching: space lost to the min_alloc_size boundary or padding.

Compression acceptance test

Rejected: stored uncompressed

want = roundup(64 KiB × 0.875, 64 KiB) = 64 KiB
result = roundup(50 KiB, 64 KiB) = 64 KiB
stored uncompressed: 64 KiB (compress_rejected_count++)

min_alloc_size is fixed when the OSD is created, and OSDs built before Pacific may still have 64K; check with ceph osd metadata. For millions of small objects, classic EC can cost more than three replicas (chapter 12).

Follows:

  • src/common/options/global.yaml.in :: bluestore_min_alloc_size_hdd, bluestore_min_alloc_size_ssd, bluestore_compression_required_ratio Allocation and compression defaults
  • src/os/bluestore/BlueStore.cc :: BlueStore::_do_alloc_write (want_len, result_len) The compression acceptance test
  • src/common/options/mon.yaml.in :: osd_pool_erasure_code_stripe_unit (4K, or 16K with allow_ec_optimizations) The EC stripe_unit
A fixed snapshot of the simulator; the interactive version is in the web edition's lab. Interactive lab: Real space in BlueStore: min_alloc_size, padding and compression