NGINX using 100% of the server CPU when testing with Blitz.io

Maxim Dounin mdounin at mdounin.ru
Thu Nov 27 15:07:58 UTC 2014


Hello!

On Thu, Nov 27, 2014 at 09:21:49AM -0500, julianfernandes wrote:

> Ok, just tested it with HTTP instead of HTTPS and while it did reach 100% of
> CPU usage from time to time, the average load was 50% and the Blitz.io test
> was a lot better:
> - 33,086 HITS WITH 29 ERRORS & 2,344 TIMEOUTS
> 
> Why would SSL perform so badly? I generated the key with 4096 instead of
> 2048, but I don't believe that would affect CPU usage this much.

The "openssl speed rsa" output should give you an idea how key 
sizes can affect CPU usage.  E.g., my laptop can do about 500 RSA 
signs per second per core with 2048 bit key, but only 60 signs per 
second with 4096 key:

$ openssl speed rsa
...
                  sign    verify    sign/s verify/s
rsa  512 bits 0.000094s 0.000008s  10585.4 119973.8
rsa 1024 bits 0.000262s 0.000020s   3810.5  49395.9
rsa 2048 bits 0.001786s 0.000058s    560.1  17351.8
rsa 4096 bits 0.014317s 0.000256s     69.8   3908.9

Even with 2048 bit keys, SSL needs way more CPU than plain HTTP, 
that's expected.

-- 
Maxim Dounin
http://nginx.org/



More information about the nginx mailing list