diff --git a/internal/http/dial_linux.go b/internal/http/dial_linux.go index 7d61cae1c..2ab7ded7e 100644 --- a/internal/http/dial_linux.go +++ b/internal/http/dial_linux.go @@ -67,8 +67,9 @@ func setTCPParameters(network, address string, c syscall.RawConn) error { // Set tcp user timeout in addition to the keep-alive - tcp-keepalive is not enough to close a socket // with dead end because tcp-keepalive is not fired when there is data in the socket buffer. // https://blog.cloudflare.com/when-tcp-sockets-refuse-to-die/ - // This is a sensitive configuration, it is better to set it to high values, > 60 secs - _ = syscall.SetsockoptInt(fd, syscall.IPPROTO_TCP, unix.TCP_USER_TIMEOUT, (15+5*15)*1000) + // This is a sensitive configuration, it is better to set it to high values, > 60 secs since it can + // affect clients reading data with a very slow pace (disappropriate with socket buffer sizes) + _ = syscall.SetsockoptInt(fd, syscall.IPPROTO_TCP, unix.TCP_USER_TIMEOUT, 10*60*1000) }) return nil }