Welcome! Log In Create A New Profile

Advanced

Re: Confused between proxy_socket_keepalive & (upstream) keepalive?

Maxim Dounin
April 06, 2020 11:34AM
Hello!

On Mon, Apr 06, 2020 at 09:55:44AM -0500, J.R. wrote:

> For my setup I use the 'upstream' directive, and in that module there
> is the 'keepalive' syntax:
>
> https://nginx.org/en/docs/http/ngx_http_upstream_module.html#keepalive
>
> I just noticed today in the proxy module there is the
> 'proxy_socket_keepalive' syntax:
>
> http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_socket_keepalive
>
> I'm a little confused... The upstream you set the # of keepalive
> connections you want. The proxy module is just an on/off...

The "proxy_socket_keepalive" directive is to set the SO_KEEPALIVE
socket option, which is to detect broken connections by sending
TCP keepalive probes periodically. It is may make sense to turn
this on in complex setups if there are upstream connections which
does not transfer anything for a long time (for example, when
proxying WebSockets with large timeouts). For client-side
connections, the same option can be set using the "so_keepalive"
parameter of the "listen" directive.

While the name is somewhat similar, it is unrelated to keeping
connections alive between requests.

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

Confused between proxy_socket_keepalive & (upstream) keepalive?

J.R. April 06, 2020 10:56AM

Re: Confused between proxy_socket_keepalive & (upstream) keepalive?

Maxim Dounin April 06, 2020 11:34AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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