Welcome! Log In Create A New Profile

Advanced

Re: Reverse Proxy with 500k connections

Maxim Konovalov
March 09, 2017 04:34AM
This is just a matter of number of ip addresses you have in a
proxy_bind pool and suitable hash function for the split_clients map.

Adding additional logic to proxy_bind ip address selection you still
can face the same problem.

On 3/8/17 9:45 PM, Tolga Ceylan wrote:
> is IP_BIND_ADDRESS_NO_PORT the best solution for OP's case? Unlike the
> blog post with two backends, OP's case has one backend server. If any
> of the hash slots exceed the 65K port limit, there's no chance to
> recover. Despite having enough port capacity, the client will receive
> an error if the client ip/port hashed to a full slot.
>
> IMHO picking bind IP based on a client ip/port hash is not very robust
> in this case since
> you can't really make sure you really are directing %10 of the
> traffic. This solution does
> not consider long connections (web sockets) and the hash slot could
> get out of balance
> over time.
>
>
> On Wed, Mar 8, 2017 at 3:20 AM, Maxim Konovalov <maxim@nginx.com> wrote:
>> On 3/7/17 10:50 PM, larsg wrote:
>>> Hi,
>>>
>>> we are operating native nginx 1.8.1 on RHEL as a reverse proxy.
>>> The nginx routes requests to a backend server that can be reached from the
>>> proxy via a single internal IP address.
>>> We have to support a large number of concurrent websocket connections - say
>>> 100k to 500k.
>>>
>>> As we don't want to increase the number of proxy instances (with different
>>> IPs) and we cannot use the "proxy_bind transarent" option (was introduced in
>>> a later nginx release, upgrade is not possible) we wanted to configure the
>>> nginx to use different source IPs then routing to the backend. Thus, we want
>>> nginx to select an available source ip + source port when a connection is
>>> established with the backend.
>>>
>>> For that we assigned ten internal IPs to the proxy server and used the
>>> proxy_bind directive bound to 0.0.0.0.
>>> But this approach seems not to work. The nginx instance seems always use the
>>> first IP as source IP.
>>> Using multiple proxy_bind's is not possible.
>>>
>>> So my question is: How can I configure nginx to select from a pool of source
>>> IPs? Or generally: to overcome the 64k problem?
>>>
>> We ever wrote a blog post for you!
>>
>> https://www.nginx.com/blog/overcoming-ephemeral-port-exhaustion-nginx-plus/
>>
>> As a side note: I'd really encourage all of you to add our blog rss
>> to your feeds. While there is some marketing "noise" we are still
>> trying to make it useful for tech people too.
>>
>> --
>> Maxim Konovalov
>> _______________________________________________
>> nginx mailing list
>> nginx@nginx.org
>> http://mailman.nginx.org/mailman/listinfo/nginx
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
>


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

Reverse Proxy with 500k connections

larsg March 07, 2017 02:50PM

Re: Reverse Proxy with 500k connections

Nelson Marcos March 07, 2017 04:14PM

Re: Reverse Proxy with 500k connections

Rainer Duffner March 07, 2017 04:24PM

Re: Reverse Proxy with 500k connections

Tolga Ceylan March 07, 2017 05:12PM

Re: Reverse Proxy with 500k connections

Andrei Belov March 07, 2017 06:40PM

Re: Reverse Proxy with 500k connections

Tolga Ceylan March 07, 2017 07:58PM

Re: Reverse Proxy with 500k connections

Maxim Konovalov March 08, 2017 06:18AM

Re: Reverse Proxy with 500k connections

larsg March 09, 2017 09:52AM

Re: Reverse Proxy with 500k connections

larsg March 09, 2017 12:20PM

RE: Reverse Proxy with 500k connections

Reinis Rozitis March 09, 2017 12:10PM

Re: RE: Reverse Proxy with 500k connections

larsg March 09, 2017 01:10PM

Re: Reverse Proxy with 500k connections

Konstantin Pavlov March 09, 2017 02:26PM

Re: Reverse Proxy with 500k connections

larsg March 13, 2017 10:22AM

Re: Reverse Proxy with 500k connections

foxgab July 14, 2017 02:15AM

Re: Reverse Proxy with 500k connections

Maxim Konovalov March 08, 2017 06:20AM

Re: Reverse Proxy with 500k connections

Maxim Konovalov March 09, 2017 04:34AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 103
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready