我发现了有关 OpenSSL 性能的一些奇怪的事情。
这是在运行 RHEL/OEL 6.4x64 和 OpenSSL 1.0.0-fips 的双 E5-2680 的物理 HP Bl460c Gen8 上“openssl speed aes-128-cbc”的输出;
Doing aes-128 cbc for 3s on 16 size blocks: 19853475 aes-128 cbc's in 2.99s
Doing aes-128 cbc for 3s on 64 size blocks: 5366868 aes-128 cbc's in 3.00s
Doing aes-128 cbc for 3s on 256 size blocks: 1364167 aes-128 cbc's in 3.00s
Doing aes-128 cbc for 3s on 1024 size blocks: 343297 aes-128 cbc's in 2.99s
Doing aes-128 cbc for 3s on 8192 size blocks: 43002 aes-128 cbc's in 3.00s
我在同一台刀片服务器上安装了 OpenSSL 1.0.1f 并重新测试,得到了以下结果;
Doing aes-128 cbc for 3s on 16 size blocks: 19887908 aes-128 cbc's in 2.99s
Doing aes-128 cbc for 3s on 64 size blocks: 5367604 aes-128 cbc's in 3.00s
Doing aes-128 cbc for 3s on 256 size blocks: 1365296 aes-128 cbc's in 3.00s
Doing aes-128 cbc for 3s on 1024 size blocks: 343261 aes-128 cbc's in 3.00s
Doing aes-128 cbc for 3s on 8192 size blocks: 42996 aes-128 cbc's in 2.99s
它们大体上相似。
但作为参考,我在运行 SuSE 11 和 OpenSSL 0.9.8-fips 的设备 VM(4 x vCPU、8GB、ESXi 5.5,位于与上面相同的刀片上)上运行了相同的测试,并得到了以下结果;
Doing aes-128 cbc for 3s on 16 size blocks: 31056333 aes-128 cbc's in 2.99s
Doing aes-128 cbc for 3s on 64 size blocks: 10296043 aes-128 cbc's in 3.00s
Doing aes-128 cbc for 3s on 256 size blocks: 2772200 aes-128 cbc's in 2.99s
Doing aes-128 cbc for 3s on 1024 size blocks: 712440 aes-128 cbc's in 3.00s
Doing aes-128 cbc for 3s on 8192 size blocks: 89701 aes-128 cbc's in 2.99s
大多数情况下性能提高一倍以上!
有人知道这里发生了什么吗 - 我已经阅读了大量有关其硬件 AES-NI 组件的 OpenSSL 文档和英特尔的 OpenSSL 文档,但我对此感到困惑。