Websockets max connections with SSL + slow

zanadu2 nginx-forum at nginx.us
Tue May 5 14:54:09 UTC 2015


Hi guys,

We set up a basic reverse proxy configuration (that you can find below this
thread).
Our main app is using websocket, and the reverse proxy works fine when no
using SSL.

But when SSL is enabled, we noticed a big performance issue making our app
very slow. Moreover, the most important: we get a problem when reaching the
50th websocket alive connection for a given user: it crashes our app.

Could you help us finding what's wrong in the following? 

App server conf:
- ubuntu v.14.10

Nginx server conf:
- nginx v1.9.0
- ubuntu v.14.04

and the conf file is the following:

###################################

user nginx_user nginx_user;
daemon off;
worker_processes  2;

pid        logs/nginx.pid;

events {
    worker_connections  1024;
}


http {
    include       mime.types;
    default_type  application/octet-stream;

    server {
        listen       8443 ssl;
        server_name  ourapp.com;

        ssl_certificate ../ssl/cacert.pem;
        ssl_certificate_key ../ssl/privkey.pem;

        ssl_session_cache    shared:SSL:1m;
        ssl_session_timeout  5m;

        ssl_ciphers  HIGH:!aNULL:!MD5;
        ssl_prefer_server_ciphers  on;

        location / {
                proxy_pass http://ourapp.com:8800;
        }

        location /our_ws_location {
                proxy_pass http://ourapp.com:8801;

                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forwarded-For
$proxy_add_x_forwarded_for;
                proxy_set_header Host $host;
                proxy_set_header X-NginX-Proxy true;

                # WebSocket support
                proxy_http_version 1.1;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection "upgrade";
        }
    }
}

###################################

Thanks in advance,

Regards,

Z

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,258666,258666#msg-258666



More information about the nginx mailing list