Enabling Block Storage
This section describes how to use the compression algorithm in block storage scenarios.
Enabling the compression algorithm
1 2 3 | ceph osd pool create vdbench 1024 1024 ceph osd pool set vdbench compression_algorithm glz ceph osd pool set vdbench compression_mode force |
Setting the compression ratio
1 | ceph osd pool set vdbench compression_required_ratio .99 |
Changing the compression algorithm level
- The compression algorithm supports two levels: 0 and 1. Level 0 indicates the high-performance mode, whereas level 1 indicates the high-compression mode.
- By default, compressor_glz_level is set to 0 on Ceph. If the high-performance mode is required, retain the default settings. If the high-compression mode is required, change the value to 1 based on 2.
- Open the ceph.conf file.
1vi /etc/ceph/ceph.conf - Press i to enter the insert mode and set compressor_glz_level to 1.
1compressor_glz_level = 1

- Press Esc to exit the insert mode. Type :wq! and press Enter to save the file and exit.
- Restart the OSD for the modification to take effect.
1systemctl restart ceph-osd.target
Parent topic: Enabling the Compression Algorithm