Welcome! Log In Create A New Profile

Advanced

Re: Nginx as reverse proxy scalability

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

On Tue, May 10, 2016 at 05:37:55PM +0200, Artur wrote:

> Thanks for your answer.
>
> Le 10/05/2016 à 17:04, Maxim Dounin a écrit :
> > 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.
> I currently have nginx running on the same host that my backends.
> I have 4 of them listening on different ports on 127.0.0.1.
> In this situation may I expect 4 times 65000 simultaneous connections ?

Yes.

(Note though, that this may not be true on all OSes. And this
also won't be true when using proxy_bind, as OS will have to
choose a local port before the destination address is known.)

> > - add more local addresses on nginx side and use proxy_bind to
> > balance users between these addresses.
> Yes, I've seen this, however I didn't catch how to dynamically assign a
> value to proxy_bind from a pool of IP addresses in nginx (not Nginx Plus).

The blog post as linked by Maxim Konovalov uses the split_clients
module, it's not nginx-plus specific. See here for details:

http://nginx.org/en/docs/http/ngx_http_split_clients_module.html

Depending on your particular case, there may be even easier
solutions. E.g., if you have two URIs in your application with
more or less equal load, you can use two locations with distinct
addresses configured statically:

location /one {
proxy_pass http://127.0.0.1:8080;
proxy_bind 127.0.0.2;
}

location /two {
proxy_pass http://127.0.0.1:8080;
proxy_bind 127.0.0.3;
}

--
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: 168
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