Nginx Performance Tuning With KAE in Docker Containers
Start the Nginx service in the Docker container and compare the performance test results when KAE is disabled and enabled.
- Modify the Nginx configuration file, start the Nginx service in the container. Prepare to verify the performance improvement provided by KAE in encryption and decryption.
- Open the /usr/local/nginx/conf/nginx.conf file.
1vi /usr/local/nginx/conf/nginx.conf - Press i to enter the insert mode and set the number of Nginx service processes to 4 in the file. In this example, Docker is bound to only four cores. Therefore, the number of Nginx service processes must be 4.
1 2 3 4 5 6 7 8
user root; worker_processes 4; worker_cpu_affinity 100000000000000000000 1000000000000000000000 10000000000000000000000 100000000000000000000000 ;

- Press Esc, type :wq!, and press Enter to save the file and exit.
- Open the /usr/local/nginx/conf/nginx.conf file.
- In the Docker container, disable KAE, start the Nginx service, and perform a pressure test.
- Perform the following operations on the server:
- Cancel the KAE environment variable to use the pure CPU computing power without KAE (soft computing power) by default.
unset OPENSSL_CONF
- Start the Nginx service. According to 3, the Docker has been bound to cores 20-23. There is no need to specify cores again.
/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
- Monitor the VF queue consumption.
- Cancel the KAE environment variable to use the pure CPU computing power without KAE (soft computing power) by default.
- Perform the following operations on the client:
Use the httpress tool to perform a pressure test on the server.
httpress -n 500000 -c 100 -t 100 https://192.168.5.71:20000/index.html
Test result: The server completes 2,243 requests per second.

- Perform the following operations on the server:
- In the Docker container, enable KAE, start the Nginx service, and perform a pressure test.
- Perform the following operations on the server:
- Cancel the KAE environment variable to use the pure CPU computing power without KAE (soft computing power) by default.
export OPENSSL_CONF=/home/openssl.cnf
- Start the Nginx service. According to 3, the Docker has been bound to cores 20-23. There is no need to specify cores again using taskset -c. The number of processes is 4, so is the number of cores.
/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
- Monitor the VF queue consumption. If extra virtual devices are created, the number of VF queues for three devices changes to 768. When KAE is enabled, the VF queue is consumed and the number is less than 768.
watch -n 0.2 cat /sys/class/uacce/hisi_*/available_instances
- Cancel the KAE environment variable to use the pure CPU computing power without KAE (soft computing power) by default.
- Perform the following operations on the client:
Use the httpress tool to perform a pressure test on the server.
httpress -n 500000 -c 100 -t 100 https://192.168.5.71:20000/index.html
Test result: The server completes 4,368 requests per second.

According to the performance test results in 2 and 3, the performance metrics before and after KAE is enabled are 2,243 rps and 4,368 rps, respectively. The performance is improved by about 94%.
- Perform the following operations on the server: