I'm designing an application that make will use of WebSocket to notify visitors quickly when changes occur. I'm planning to proxy the connections with Nginx, so they can share the same address as the regular HTTP portion. One thing I'm concerned about is the exhaustion of ephemeral ports. In the past, I have noticed problems when the number of connections between Nginx and the Node backend exceeds 25000. My question is, would the following config increases the limit to 100K?
upstream backends {
server 127.0.0.1:5000;
server 127.0.0.2:5000;
server 127.0.0.3:5000;
server 127.0.0.4:5000;
}
The limit on open files will need to be raised accordingly, of course.
Assuming the technique works, can it be used with external servers? How hard is it to assign a range of IP addresses to an interface? Networking is not my forte...
Please try proxy_bind . It
So if our nginx proxy server can have several IP addresses your problem can be resolved. e.g.
The variable
$picked_ip
can be computed by a rewrite handler which runs beforeproxy_pass
does.