r/haproxy • • Jun 17 '25

Session Timeout

I have an issue where the haproxy server is timing out after 5 minutes even when I have the timeout queue,client and server all set to 35 minutes. The linux box itself has the net.ipv4.tcp.keepalive-time=1800, net.ipv4.tcp.keepalive-intrvl=60 and net.ipv4.tcp.keepalive-probes=9 but still server times out after 5 minutes. if I set the keep alive time to 240 then it stays up for ever. What I want is the connection to drop after 30 minutes of being idle. What am I missing here?

2 Upvotes

5 comments sorted by

View all comments

Show parent comment

1

u/Practical-Ice-9464 Jun 18 '25 edited Jun 18 '25

I don't think the http-keep-alive is related because this is not http traffic. The termination flag in the log show SD 1/1/0/0/0 0/0 when it times out and when we close the connection we see CD 1/1/0/0/0 0/0. When I say idle I mean we make the connection and we let it sit and we don't want it to termination the connection until 30 minutes. This is not a web socket it's actually telnet.

1

u/BarracudaDefiant4702 Jun 18 '25

You are right, http-keep-alive isn't relevant, because I missed the mode tcp in the default section... The SD means it closed on the server side. There is a probably a timeout on server lun1 1.1.1.1:1024 (I assume that's not the real IP?). Can you connect to that directly and idle over 5 minutes? What about from the same machine haproxy is running on? Have you checked the logs on the server? Based on the SD it does sound either server side, or connection tracking / firewall dropping the connection.