Search code examples
haproxysession-timeout

HAProxy, "timeout tunnel" vs "timeout client/server"


When configuring HAProxy, what is the difference between setting "timeout tunnel" alone vs setting both "timeout client" and "timeout server", all to the same value?


Solution

  • Timeout client and timeout server applies respectively on the client side and server side from an HAProxy point of view. They mean the inactivity timeout on this part of the connection. They both apply in TCP and HTTP mode, that said, in HTTP timeout server also means "max time for server to generate an answer". timeout tunnel applies only on HTTP mode, when HAProxy performs in tunnel mode or when a websocket is established. More information about timeout tunnel for websockets here (and a comparison with the timeout mentioned previously): https://www.haproxy.com/blog/websockets-load-balancing-with-haproxy/