Re: [lvs-users] connection broken during two hours by using LVS as load

To: lvs-users@xxxxxxxxxxxxxxxxxxxxxx, rich4tech@xxxxxxxxx
Subject: Re: [lvs-users] connection broken during two hours by using LVS as load balancer
From: Jason Stubbs <j.stubbs@xxxxxxxxxxxxxxx>
Date: Fri, 27 Jun 2008 09:53:29 +0900
On Friday 27 June 2008 03:21:02 richard zhao wrote:
> Hello, All
> I developed a Client/Server program in which client will
> establish a persistent connection with Server and then client and
> server will maintain this connection for a very long time. this week, I
> use LVS as load balancer. I found that the connection between Client
> and Server are broken at the exact two hours. if I don't use the LVS,
> the connection never break under the same environment. For this LVS, 
> the packet forwarding method is gatewaying, the scheduler which I tried
> is lblc, I also tried --persistent. they have same results.  Does
> anyone have such experience? could anyone explain why that happened and
> tell me how to avoid. thank you very much in advance.

It sounds like the tcp session timeout, which is configurable with
ipvsadm --set. However, after a search I found the defaults in
ip_vs_proto_tcp.c in the kernel:

static int tcp_timeouts[IP_VS_TCP_S_LAST+1] = {
        [IP_VS_TCP_S_NONE]              =       2*HZ,
        [IP_VS_TCP_S_ESTABLISHED]       =       15*60*HZ,
        [IP_VS_TCP_S_SYN_SENT]          =       2*60*HZ,
        [IP_VS_TCP_S_SYN_RECV]          =       1*60*HZ,
        [IP_VS_TCP_S_FIN_WAIT]          =       2*60*HZ,
        [IP_VS_TCP_S_TIME_WAIT]         =       2*60*HZ,
        [IP_VS_TCP_S_CLOSE]             =       10*HZ,
        [IP_VS_TCP_S_CLOSE_WAIT]        =       60*HZ,
        [IP_VS_TCP_S_LAST_ACK]          =       30*HZ,
        [IP_VS_TCP_S_LISTEN]            =       2*60*HZ,
        [IP_VS_TCP_S_SYNACK]            =       120*HZ,
        [IP_VS_TCP_S_LAST]              =       2*HZ,

Established connections expire after 15 minutes of inactivity by default.
Unless your distribution has changed it of course... I'd experiment with
using ipvsadm --set to confirm that it is the issue. And if it is, I guess
the next question would be "is it possible to disable timeouts on
established session?" That, I don't know.

Jason Stubbs <j.stubbs@xxxxxxxxxxxxxxx>
東京都渋谷区桜ヶ丘町22-14 N.E.S S棟 3F
TEL 03-5728-4772  FAX 03-5728-4773

_______________________________________________ mailing list - lvs-users@xxxxxxxxxxxxxxxxxxxxxx
Send requests to lvs-users-request@xxxxxxxxxxxxxxxxxxxxxx
or go to
<Prev in Thread] Current Thread [Next in Thread>