Installing and Enabling the Feature
To enable the network asynchronization feature on Redis, install the related dependency libraries, compile the SO file, and apply the patch. This section uses Redis 7.0.15 as an example.
- Download the required dependencies.
1yum -y install wget git vim tar make gcc gcc-c++ libatomic texinfo libtool
- Install the liburing.a library.
1 2 3 4 5 6
git clone https://gitee.com/src-openeuler/liburing.git cd liburing tar -zxvf liburing-2.4.tar.gz cd liburing-2.4 make -j make install
- Install the libconfig library.
1 2 3 4 5 6 7 8 9
git clone https://gitee.com/src-openeuler/libconfig.git cd libconfig tar -zxvf v1.8.1.tar.gz cd libconfig-1.8.1 autoreconf --install --force ./configure --prefix=/usr/local make -j make install cp /usr/local/lib/libconfig.so.15 /usr/lib64
- Download the patch package of the network asynchronization feature for Redis 7.0.15 as instructed in Table 2.
- Download the KRAIO library and decompress the package.
- Create a /etc/kraio folder and copy the kraio.conf file in kraio to /etc/kraio.
1 2 3
cd kraio mkdir /etc/kraio cp conf/kraio.conf /etc/kraio
- Place the downloaded SO file and kraio.h file in the corresponding paths and configure environment variables.
1 2 3 4
cp ./libkraio/libkraio.so /usr/lib64 cp ./include/kraio.h /usr/include export PATH=/usr/local/include:$PATH export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib64:/usr/lib
- Move the redis-7.0.15-adapt-iouring.patch file in Redis to the Redis source code directory and apply the patch.
Redis 7.0.15 is used as an example. For Redis 6.0.20, move the redis-6.0.20-adapt-iouring.patch file to the Redis source code directory and apply the patch. In the subsequent operations, replace the version number in commands.
1 2 3 4 5
git clone https://gitcode.com/BoostKit/Redis.git cd Redis cp redis-7.0.15-adapt-iouring.patch path/redis-7.0.15/ cd path/redis-7.0.15 patch -p1 < redis-7.0.15-adapt-iouring.patch
- Recompile Redis.
1 2 3
cd path/redis-7.0.15 make distclean make -j
- Modify the /etc/kraio/kraio.conf file.
- Go to /etc/kraio.
cd /etc/kraio
- Open the kraio.conf file.
vim kraio.conf
- Press i to enter the insert mode and make the following changes: send_callback=1, zero_copy=1, and log_level=3.

- Press Esc, type :wq!, and press Enter to save the file and exit.
- Go to /etc/kraio.
- During the testing, run the following command on the server. If any iou-sqp-* thread is displayed, the feature is successfully enabled.
1top -Hp <redis-server Instance pid>

Parent topic: Feature Guide