Testing the vKAE Performance Using OpenSSL
On the client, the RSA encryption and decryption algorithm is used as an example. The OpenSSL tool is used to perform detailed performance tests on vKAE, covering the synchronous/asynchronous modes of the open source Nginx and the synchronous/asynchronous modes of Nginx with vKAE enabled. The test results are analyzed in detail, and conclusions and suggestions are provided.
Test Commands
The following uses a 4C8G VM as an example. Four groups of performance tests using OpenSSL on the VM are performed, covering the synchronous and asynchronous modes of the open source Nginx and the synchronous and asynchronous modes of Nginx with vKAE enabled.
The test commands of each group are as follows:
- Nginx synchronous mode:
numactl -C 0 openssl speed -elapsed -multi 1 rsa2048
- Nginx asynchronous mode:
numactl -C 0 openssl speed -elapsed -multi 1 -async_jobs 4 rsa2048
- vKAE enabled + Nginx synchronous mode:
OPENSSL_CONF=/home/openssl.cnf numactl -C 0 openssl speed -engine kae -elapsed -multi 1 rsa2048
- vKAE enabled + Nginx asynchronous mode:
OPENSSL_CONF=/home/openssl.cnf numactl -C 0 openssl speed -engine kae -elapsed -multi 1 -async_jobs 4 rsa2048
Adjust the following parameters as required:
- numactl -C 0: CPU core 0 is bound.
- -m 0: NUMA node0 is bound.
- -engine kae -elapsed: KAE is used for acceleration.
- -multi: Number of concurrent threads. The value 1 indicates that there is no parallel operation, that is, only one operation is performed at a time.
- -async_jobs: Number of asynchronous jobs. The value 4 indicates that four asynchronous jobs are started at the same time.
Test Results and Analysis
Table 1 shows the RSA-sign results of the tests on a 4C8G VM where the openssl speed command is used.
Processor |
Number of Server Threads = 1 |
Number of Server Threads = 4 |
VM Specification |
Nginx Synchronous/Asynchronous |
vKAE Enabled/Not Enabled |
|---|---|---|---|---|---|
Kunpeng 920 |
6374 |
12528 |
4C8G |
Synchronous |
Enabled |
Kunpeng 920 |
15593 |
52514 |
4C8G |
Asynchronous |
Enabled |
Kunpeng 920 |
774 |
3100 |
4C8G |
Synchronous |
Not enabled |
Kunpeng 920 |
774 |
3096 |
4C8G |
Asynchronous |
Not enabled |
Conclusions are drawn under the circumstance that the CPU usage reaches 100%:
- vKAE acceleration performance: In a 4C8G VM, hardware acceleration provided by vKAE significantly improves the performance. Before the vKAE acceleration reaches its bottleneck, the performance is improved by 16 times for the asynchronous mode and by 3 times in the synchronous mode.
- Comparison between the synchronous and asynchronous modes: With vKAE enabled in the OpenSSL scenario, the performance of the asynchronous mode is 4.2 times higher than that of the synchronous mode, showing asynchronous mode's advantages in high-concurrency scenarios. When vKAE is not enabled, the performance of the synchronous and asynchronous modes are almost the same.
- Computing power ratio analysis: The computing power ratio in the synchronous mode is about 4 times. In asynchronous mode, the computing power ratio is about 17 times. This indicates that the asynchronous mode is more efficient in using hardware acceleration resources.
The computing power ratio refers to the ratio of the computing power empowered by hardware acceleration to the pure CPU computing power without KAE.
Conclusion and Application Suggestions
For VMs of the 4C8G specification:
- Advantages of vKAE hardware acceleration: In a VM environment with limited resources, vKAE hardware acceleration is effective in improving the RSA signature performance.
- Advantages of the asynchronous mode: For applications that need to process a large number of concurrent requests, it is recommended the Nginx asynchronous mode together with vKAE hardware acceleration be used to achieve optimal performance.
- The test results and trends vary depending on the number of server threads and VM specifications. However, in the Nginx application scenario, for the Nginx server, as far as the number of CPU cores to bind does not exceed 64, the upper limit of the RSA-sign performance empowered by vKAE hardware acceleration is at about 54,000 sign/s, which provides a useful reference for actual scenarios.