I try to configure keep-alive connection for HAProxy. However, HAProxy terminates the connection after some timeout which is based on my tries is: min of (timeout keep-aliv, timeout client)
Here is the config:
defaults
log global
mode http
option httplog
option dontlognull
option persist
option redispatch
option forwardfor
option http-keep-alive
timeout connect 5s
timeout check 5s
timeout client 31s
timeout server 600s
timeout http-keep-alive 300s
With this configuration tcpdump shows that HAProxy sends FIN, ACK after 31s to client. If I change http-keep-alive to 20s then FIN, ACK will be send after 20s. Basically, it's unclear to me how better to configure HAProxy to use high keep alive timeout.