meta data for this page
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| vm:proxmox:ceph:compression [2025/10/29 10:17] – niziak | vm:proxmox:ceph:compression [2025/10/29 10:47] (current) – niziak | ||
|---|---|---|---|
| Line 5: | Line 5: | ||
| [[https:// | [[https:// | ||
| + | ===== get compression ratio ===== | ||
| <code bash> | <code bash> | ||
| - | ceph osd pool set rbd compression_algorithm snappy | + | ceph df detail |
| + | |||
| + | --- POOLS --- | ||
| + | POOL | ||
| + | rbd | ||
| + | </ | ||
| + | |||
| + | * **USED COMPR**: The amount of space allocated for compressed data. This includes compressed data in addition to all of the space required for replication, | ||
| + | * **UNDER COMPR**: The amount of data that has passed through compression (summed over all replicas) and that is worth storing in a compressed form. | ||
| + | |||
| + | ===== enable compression | ||
| + | |||
| + | <code bash> | ||
| + | ceph osd pool set {pool-name} | ||
| + | </ | ||
| + | |||
| + | * {pool-name}: | ||
| + | * {algorithm}: | ||
| + | * zstd: A modern and fast compression algorithm. | ||
| + | * snappy: A good default with high performance and a decent compression ratio. | ||
| + | * lz4: Very fast but with a lower compression ratio. | ||
| + | * none: Disables compression for the poo | ||
| + | |||
| + | * Snappy — A fast and efficient compression algorithm developed by Google. It prioritizes speed over compression ratio. Snappy is used by default in Spark. | ||
| + | * LZ4 — A very fast compression algorithm that focuses on decompression speed. LZ4 provides a good balance between speed and compression ratio. | ||
| + | * ZStandard (ZStd) — A modern compression algorithm that provides a good compression ratio while still being pretty fast. ZStd offers compression ratios comparable to ZLib with faster compression/ | ||
| + | |||
| + | * tbd | ||
| + | * none: Never compress data. | ||
| + | * passive: Do not compress data unless the write operation has a compressible hint set. | ||
| + | * aggressive: Do compress data unless the write operation has an incompressible hint set. | ||
| + | * force: Try to compress data no matter what. | ||
| + | |||
| + | <code bash> | ||
| + | ceph osd pool set rbd compression_algorithm zstd | ||
| ceph osd pool set rbd compression_mode aggressive | ceph osd pool set rbd compression_mode aggressive | ||
| </ | </ | ||
| + | |||
| + | <code bash> | ||
| + | ceph osd pool get rbd compression_mode | ||
| + | ceph osd pool get rbd compression_algorithm | ||
| + | </ | ||
| + | |||
| + | ===== detailed statistics ===== | ||
| Check compression ratios: | Check compression ratios: | ||
| <code bash> | <code bash> | ||
| - | ceph daemon osd.2 perf dump | egrep -i "bluestore_compressed|bluestore_allocated|bluestore_stored|compress_.*_count" | + | ceph daemon osd.2 perf dump bluestore |
| - | ceph tell ' | + | ceph tell ' |
| </ | </ | ||
| or | or | ||
| <code bash> | <code bash> | ||
| - | ceph daemon osd.0 perf dump | egrep -i "bluestore_compressed|bluestore_allocated|bluestore_stored|compress_.*_count|bluestore_write_big|bluestore_write_small" | + | ceph daemon osd.0 perf dump bluestore |
| - | ceph tell ' | + | ceph tell ' |
| </ | </ | ||