Welcome! Log In Create A New Profile

Advanced

Re: Nginx as reverse proxy scalability

Maxim Dounin
May 10, 2016 11:06AM
Hello!

On Tue, May 10, 2016 at 12:26:59PM +0200, Artur wrote:

> I'm currently working on nginx limits as a reverse proxy on a Debian box.
> My current setup is a nginx configured as a http/https web server (for
> static content) and a reverse proxy for node.js processes on the same
> server and in future on other Debian boxes.
> I was unable to see (while reading the documentation) real hard
> limitations for nginx in this setup excepting ephemeral ports exhaustion.
> It may be a concern as Node.js applications usually open a websocket
> that is connected as long as a user stays connected to the application.
> If I understood everything correctly it means that nginx in this setup
> will not be able to manage more than about 64k clients connections.
> Am I right ? What can be done if I would like to go over this 64k limit
> ? Could you please suggest a solution ?

As long as you are using TCP/IP and have only one backend (ip +
port), and only one local address on nginx side, then you are
limited by the number of local ports nginx can use. Theoretical
limit is 64k, practical one is usually smaller - on Linux systems
it depends on net.ipv4.ip_local_port_range.

Most natural solution is to add more backends. Under normal
conditions you will add more backend servers as your system will
grow, so you'll never hit the problem in the first place. If you
need to handle more than 64k connections to a single backend
server, consider listening on multiple addresses in your backend
application (e.g., listening on multiple ports).

Other available solutions are:

- use UNIX domain sockets (this works when you have everything on
a single host);

- add more local addresses on nginx side and use proxy_bind to
balance users between these addresses.

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

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Nginx as reverse proxy scalability

Artur May 10, 2016 06:28AM

Re: Nginx as reverse proxy scalability

Maxim Dounin May 10, 2016 11:06AM

Re: Nginx as reverse proxy scalability

Maxim Konovalov May 10, 2016 11:26AM

Re: Nginx as reverse proxy scalability

Artur May 10, 2016 11:40AM

Re: Nginx as reverse proxy scalability

Valentin V. Bartenev May 10, 2016 11:44AM

Re: Nginx as reverse proxy scalability

Maxim Konovalov May 10, 2016 11:46AM

Re: Nginx as reverse proxy scalability

Artur May 10, 2016 11:50AM

Re: Nginx as reverse proxy scalability

Maxim Dounin May 10, 2016 11:58AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 165
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready