Forum Discussion
luther_56179
Aug 13, 2012Nimbostratus
How to Implement a keepAlive Client-Side Connection
Hi,
Our Configuration is like this:
[Clients- Host] ---connection--> [F5/BigIP] ---connection---> [Servers].
F5/BigIP kills the connection when the server spend a lot of time responding to the client.
As the connection is in a idle state when the server is working.
How can I tell to the F5 to keep the connection Alive even if it is in inactivity state ?
The connection type is TCP with HTTP 1.1. The header of the http message contains the "keep-alive" text and the client has a timeout infinite. but this doesn't work. Connection is closed by F5.
Cdt
- Richard__HarlanHistoric F5 AccountThe issue most likely is that the LTM has a 5 min TCP timeout. Once this has been reached the unit sends a reset packet too both sides of the connection. You can increase this time out though I would not set it to infinite. You can also set up TCP-keep alive to keep traffic flowing over the session and the LTM will not kill the session.
- nitassEmployeejust wondering if keep-alive setting in tcp profile does not help.
- it might, but why send the extra traffic? just increase the tcp timeout as richard suggests seems more logical.
- Richard__HarlanHistoric F5 AccountIn that case the server has to send the TCP Keep alive, the LTM will not send a TCP keep-alive. With the profile setting set the LTM will not just ACK the Keep-Alive it will also send the keep-alive to the client keeping the client connection open. So the server will have to send the Keep-alive then set the profile setting and the LTM will proxy the keep-alive to the client.
- nitassEmployeeit might, but why send the extra traffic? just increase the tcp timeout as richard suggests seems more logical.i think it holds memory and how we know if timeout value is long enough.
[root@ve10:Active] config b virtual bar list virtual bar { pool foo destination 172.28.19.79:22 ip protocol 6 profiles { tcp3s { serverside } tcp5s { clientside } } } [root@ve10:Active] config b pool foo list pool foo { members 200.200.200.101:22 {} } [root@ve10:Active] config b profile tcp3s list profile tcp tcp3s { defaults from tcp keep alive interval 3 } [root@ve10:Active] config b profile tcp5s list profile tcp tcp5s { defaults from tcp keep alive interval 5 } clientside [root@ve10:Active] config tcpdump -nni external not host 172.28.19.80 and port 22 tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on external, link-type EN10MB (Ethernet), capture size 108 bytes 23:34:23.165953 IP 172.28.19.79.22 > 172.18.205.120.21508: . ack 3549108548 win 32768 23:34:23.209586 IP 172.18.205.120.21508 > 172.28.19.79.22: . ack 1 win 254 23:34:28.209680 IP 172.28.19.79.22 > 172.18.205.120.21508: . ack 1 win 32768 23:34:28.254657 IP 172.18.205.120.21508 > 172.28.19.79.22: . ack 1 win 254 23:34:33.254961 IP 172.28.19.79.22 > 172.18.205.120.21508: . ack 1 win 32768 23:34:33.297428 IP 172.18.205.120.21508 > 172.28.19.79.22: . ack 1 win 254 serverside [root@ve10:Active] config tcpdump -nni internal not host 172.28.19.80 and port 22 tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on internal, link-type EN10MB (Ethernet), capture size 108 bytes 23:35:01.613940 IP 172.18.205.120.21508 > 200.200.200.101.22: . ack 4072446330 win 32768 23:35:01.615544 IP 200.200.200.101.22 > 172.18.205.120.21508: . ack 1 win 80 23:35:04.615892 IP 172.18.205.120.21508 > 200.200.200.101.22: . ack 1 win 32768 23:35:04.617456 IP 200.200.200.101.22 > 172.18.205.120.21508: . ack 1 win 80 23:35:07.617801 IP 172.18.205.120.21508 > 200.200.200.101.22: . ack 1 win 32768 23:35:07.619647 IP 200.200.200.101.22 > 172.18.205.120.21508: . ack 1 win 80
- hoolioCirrostratusAs Nitass said, keep-alives do make sense in this scenario so that the connection is kept open via the server's keep-alives for as long as it takes to send the response. If you only extend the TCP idle timeout on LTM, you'd eat up more memory for all connections that aren't closed cleanly.
- Richard__HarlanHistoric F5 AccountIn the long run as long as you set your TCP time out not to infinite you will reclaim the memory. With TCP timeout there are cases where it is possible that you will not close the connection. The Acking of data is a TCP function not a Application function. There are many cases were the Application will go off into space but the TCP stack will still open connection and ack data. So the memory question can be a wash. The only connection that are left in memory are the one that drop off the network and do not close the connection down and they are cleaned up when the timeout run. With keep-alives you have the chance of a connection not shunting down as long at the client and server respond.
Recent Discussions
Related Content
Â
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects