KAE zlib Compression Tuning
- Purpose
Optimize zlib compression to maximize the CPU capability of processing OSDs and maximize the hardware performance.
- Procedure
zlib compression is processed by the KAE.
Preparing the Environment
Download the acceleration engine installation package and developer guide.
Installing the Acceleration Engine
- Install the acceleration engine according to the developer guide.
- Install the zlib library.
- Replace the zlib software compression algorithm dynamic library.
1 2 3 4
cd /usr/local/kaezip/lib cp libz.so.1.2.11 /lib64/ mv /lib64/libz.so.1 /lib64/libz.so.1-bak ln -s /lib64/libz.so.1.2.11 /lib64/libz.so.1
In the cd /usr/local/zlib command, /usr/local/zlib indicates the zlib installation path. Change it as required.
If the Ceph cluster is running before the dynamic library is replaced, run the following command on all storage nodes to restart the OSDs for the change to take effect after the dynamic library is replaced:
1
|
systemctl restart ceph-osd.target |
Changing the Default Number of Accelerator Queues
The default number of queues of the hardware accelerator is 256. To fully utilize the performance of the accelerator, change the number of queues to 512 or 1024.
- Remove hisi_zip.
1rmmod hisi_zip - Set the default accelerator queue parameter pf_q_num=512.
1vim /etc/modprobe.d/hisi_zip.conf1options hisi_zip uacce_mode=2 pf_q_num=512
- Load hisi_zip.
1modprobe hisi_zip - Check the hardware accelerator queue.
1cat /sys/class/uacce/hisi_zip-*/attrs/available_instancesThe change is successful if the following information is displayed.

- Check the dynamic library links. If libwd.so.1 is contained in the command output, the operation is successful.
1ldd /lib64/libz.so.1
Adapting Ceph to the Accelerator
Currently, the mainline Ceph versions allow configuring the zlib compression mode using the configuration file. The released Ceph release versions (up to v15.2.3) adopt the zlib compression mode without the data header and tail. However, the current hardware acceleration library supports only the mode with the data header and tail. Therefore, the Ceph source code needs to be modified to adapt to the Kunpeng hardware acceleration library. For details about the modification method, see the latest patch that has been incorporated into the mainline version:
https://github.com/ceph/ceph/pull/34852
The following uses Ceph 14.2.11 as an example to describe how Ceph adapts to the zlib compression engine.
- Obtain the source code.
https://download.ceph.com/tarballs/

After the source package is downloaded, save it to the /home directory on the server.
- Obtain the patch and save it to the /home directory.
https://gitee.com/kunpengcompute/ceph/releases/download/v14.2.11/ceph-14.2.11-glz.patch
- Go to the /home directory, decompress the source package and enter the directory generated after decompression.
1cd /home && tar -zxvf ceph-14.2.11.tar.gz && cd ceph-14.2.11/
- Apply the patch in the root directory of the source code.
1 2
cd /home/ceph-14.2.11 patch -p1 < ceph-14.2.11-glz.patch
- After modifying the source code, compile Ceph.
For details about the compilation procedure, see Ceph 14.2.8 Compilation Guide (CentOS 7.6 & openEuler 20.03 & openEuler 22.03).
- Install Ceph.
- Modify the ceph.conf file to configure the zlib compression mode.
1vim /etc/ceph/ceph.confcompressor_zlib_winsize=15
- Restart the Ceph cluster for the configuration to take effect.
1ceph daemon osd.0 config show|grep compressor_zlib_winsize
