meta data for this page
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| vm:proxmox:ceph:compression [2021/01/28 18:31] – created niziak | vm:proxmox:ceph:compression [2025/10/29 10:47] (current) – niziak | ||
|---|---|---|---|
| Line 3: | Line 3: | ||
| [[https:// | [[https:// | ||
| + | [[https:// | ||
| + | ===== get compression ratio ===== | ||
| + | |||
| + | <code bash> | ||
| + | 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} compression_algorithm {algorithm} | ||
| + | </ | ||
| + | |||
| + | * {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 | ||
| + | </ | ||
| + | |||
| + | <code bash> | ||
| + | ceph osd pool get rbd compression_mode | ||
| + | ceph osd pool get rbd compression_algorithm | ||
| + | </ | ||
| + | |||
| + | ===== detailed statistics ===== | ||
| + | |||
| + | Check compression ratios: | ||
| + | <code bash> | ||
| + | ceph daemon osd.2 perf dump bluestore | egrep -i " | ||
| + | ceph tell ' | ||
| + | </ | ||
| + | |||
| + | or | ||
| <code bash> | <code bash> | ||
| - | ceph osd pool set rbd compresison_algorithm zstd | + | ceph daemon |
| - | ceph osd pool set rbd compression_mode < | + | ceph tell 'osd.*' perf dump bluestore | egrep -i " |
| - | ceph osd pool set <pool-name> compression_required_ratio < | + | |
| </ | </ | ||