Nginx WebSocket Reverse Proxy Limitations

benchmarking, jmeter, nginx, proxy, websocket

Solution

If you want even more information about tweaking your nginx server you can get a short answer from here or the very longer detailed post over here

Problem

I've set up a Nginx Reverse Proxy that uses WebSocket connections and recently began benchmarking the setup with Apache JMeter. Whenever I would make over 600 requests, JMeter would return an error for some of the requests. I individually tested each back-end web-server (with WebSockets) and no request errors appeared until around 11000 requests. Is there a limit on the number of WebSocket connections Nginx allows or is there something which I have not setup correctly? My /etc/nginx/sites-available/default file is set up as well follows: ``` location / { proxy_pass http://backend; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $connection_upgrade; } ```

Original source