# Real space in BlueStore: min_alloc_size, padding and compression

*HTML: https://book.ceph-s3.ir/en/lab-bluespace.html*
*Licence: CC BY-NC-SA 4.0. Author: Ramin Najarbashi.*

[Interactive lab](lab.html)Real space in BlueStore: min_alloc_size, padding and compression
In the book: [Chapter 12](12-bluestore.html#sec-12-4-3)
LabReal space in BlueStore: min_alloc_size, padding and compressionChange 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 GiB**raw space for 1,000,000 objects**976.56 MiB**logical dataOne object's shards or replicasD0****4 KiB → 64 KiBD1****4 KiB → 64 KiBD2****4 KiB → 64 KiBD3****4 KiB → 64 KiBP4****4 KiB → 64 KiBP5****4 KiB → 64 KiBSolid: data (blue) or parity (purple) · red hatching: space lost to the min_alloc_size boundary or padding.Compression acceptance testRejected: stored uncompressedwant = 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_unitA 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](lab-bluespace.html)The interactive version needs JavaScript; this is a fixed snapshot.
