Welcome! Log In Create A New Profile

Advanced

Re: Fix proxy_bind with upstreams with keepalive

Maxim Dounin
January 21, 2021 12:56PM
Hello!

On Thu, Jan 21, 2021 at 06:24:58PM +0300, Андрей Бич wrote:

> There was a problem that we encountered: proxy_bind option is sometimes
> ignored when keepalive enabled in target upstream.
> In search for connection in cache the only comparison is with target
> address and local address set by proxy_bind is ignored.
> I'd like to propose the following change to fix this issue.
> Would like to receive your comments.

Thank you for your patch.

Cache of upstream connections only takes into account the address
of the server it connects to. If you want to take into account
other connection-related properties, such as different proxy_bind,
proxy_socket_keepalive, or various SSL options such as SNI name or
ciphers/protocols used, you are expected to take care of this
yourself, either by using different upstream{} blocks, or by not
using keepalive cache.

Further, taking proxy_bind into account doesn't look right at
least in some use cases. For example, consider a configuration
where connections to a backend are configured to use random source
IP addresses from a set of IP addresses available on the server
(such configurations are sometimes used to avoid hitting 64k
connections limit). With your patch, checking if source address
matches the one selected for a particular request will needlessly
reject some connections.

--
Maxim Dounin
http://mdounin.ru/
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

Fix proxy_bind with upstreams with keepalive

Андрей Бич 271 January 21, 2021 10:26AM

Re: Fix proxy_bind with upstreams with keepalive

Maxim Dounin 146 January 21, 2021 12:56PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 293
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