We are configuring a file delivery server using nginx. The server will be serving large files over HTTPS.
We have run into an issue where we can only achieve around 25MB/s on a single HTTPS thread.
We have tested using a non-HTTPS single download thread (http://) and can achieve full line speed (1Gb/s) at around 120MB/s.
CPU is not anywhere near max encrypting the transfers. We have PLENTY of processing power spare.
We are using aio threads and directio for the file delivery system with large output buffers.
Here is an example of our config:
server {
sendfile off;
directio 512;
aio threads;
output_buffers 1 2m;
server_name downloads.oursite.com;
listen 1.1.1.1:443 ssl;
ssl_certificate /volume1/Backups/nginxserver/ourdownloads.cer;
ssl_certificate_key /volume1/Backups/nginxserver/ourdownloads.key;
ssl on;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA';
ssl_prefer_server_ciphers on;
ssl_stapling on;
ssl_stapling_verify on;
resolver 8.8.4.4 8.8.8.8 valid=300s;
resolver_timeout 10s;
location = / {
rewrite ^ https://oursite.com/downloads.html permanent;
}
error_page 404 /404.html;
location = /404.html {
root /volume1/Backups/nginxserver/pages/;
internal;
}
location / {
root /volume1/downloads.oursite.com;
limit_conn_status 429;
limit_conn alpha 50;
}
}
Does anybody know how we can achieve faster transfer speeds for a single thread over an SSL connection? What is causing this? Thank you for your tips, suggestions, advice and help in advance.
It seems our CPU is to blame. No built-in AES encryption support.