Rate This Document
Findability
Accuracy
Completeness
Readability

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.

  1. 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.
    1. Open the /usr/local/nginx/conf/nginx.conf file.
      1
      vi /usr/local/nginx/conf/nginx.conf
      
    2. 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
      ;
      

    3. Press Esc, type :wq!, and press Enter to save the file and exit.
  2. In the Docker container, disable KAE, start the Nginx service, and perform a pressure test.
    1. Perform the following operations on the server:
      1. Cancel the KAE environment variable to use the pure CPU computing power without KAE (soft computing power) by default.
        unset OPENSSL_CONF
      2. 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
      3. 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 not enabled, the VF queue is not consumed and remains the default number 768.
        watch -n 0.2 cat /sys/class/uacce/hisi_*/available_instances
    2. 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.

  3. In the Docker container, enable KAE, start the Nginx service, and perform a pressure test.
    1. Perform the following operations on the server:
      1. 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
      2. 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
      3. 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
    2. 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%.