Welcome! Log In Create A New Profile

Advanced

Re: proxy_socket_keepalive how to?

Francis Daly
November 27, 2020 07:00AM
On Fri, Nov 27, 2020 at 06:29:16AM -0500, narksu wrote:

Hi there,

> I make a curl directly to backend
> from nginx server, there are tcp keepalive in tcpdump and I receive reply
> from backend in 40 minutes. Tried to use proxy_socket_keepalive=on in
> location section but tcpkeepalive not appear in tcpdump and session stil
> close by timeout. So what is the proper way to enable
> proxy_socket_keepalive?

The documentation at http://nginx.org/r/proxy_socket_keepalive suggests
that it is

proxy_socket_keepalive on;

but gives no obvious way to set the idle/interval/count values, so
presumably it will use your system defaults for those. Maybe your system
says "don't send the first keepalive packet until two hours have passed".

If you are on something linuxy, files with names like
/proc/sys/net/ipv4/tcp_keepalive* or the output of something like

/sbin/sysctl -ar tcp_keepalive

will probably be instructive; other systems presumably have their own
ways to configure things.

(If it is important to you to be able to set these values for nginx only,
then you could consider implementing what "listen" does, but for outgoing
connections, probably in src/http/ngx_http_upstream.c and friends. But
it is probably less work today, to change your system defaults to what
you want your nginx to use.)

Good luck with it,

f
--
Francis Daly francis@daoine.org
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

proxy_socket_keepalive how to?

narksu November 27, 2020 06:29AM

Re: proxy_socket_keepalive how to?

Francis Daly November 27, 2020 07:00AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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