LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

Re: Easing a real server into rotation

To: "LinuxVirtualServer.org users mailing list." <lvs-users@xxxxxxxxxxxxxxxxxxxxxx>
Subject: Re: Easing a real server into rotation
From: Horms <horms@xxxxxxxxxxxx>
Date: Fri, 6 Feb 2004 11:24:22 +0900
On Thu, Feb 05, 2004 at 10:04:41AM -0500, John Reuning wrote:
> I just reran the tests from 2 clients.  The director exhibited the same
> behavior for both clients:
> 
> 1. Initial connection from client established from a web browser to the
> lvs VIP.  One real server, http.  Here are the salient bits from ipvsadm
> 
> $ ipvsadm -L -n
> IP Virtual Server version 1.0.10 (size=65536)
> Prot LocalAddress:Port Scheduler Flags
>   -> RemoteAddress:Port           Forward Weight ActiveConn InActConn
> TCP  152.2.210.46:80 rr persistent 300
>   -> 192.168.2.2:80               Masq    1      1          0
> 
> $ ipvsadm -L -c -n |grep <client1>
> TCP 14:55  ESTABLISHED <client1>:49598 152.2.210.46:80    192.168.2.2:80
> TCP 00:53  SYN_RECV    <client1>:0     152.2.210.46:80    192.168.2.2:80

The first entry is the entry for the connection, the second
is the persistance template.

> 2. After 3-5 seconds, the connection switches to inactive in ipvsadm,
> and the connection state switches to FIN_WAIT.  More page loads from the
> client don't change the status of the connection on the director.  
> 
> $ ipvsadm -L -n
> IP Virtual Server version 1.0.10 (size=65536)
> Prot LocalAddress:Port Scheduler Flags
>   -> RemoteAddress:Port           Forward Weight ActiveConn InActConn
> TCP  152.2.210.46:80 rr persistent 300
>   -> 192.168.2.2:80               Masq    1      0          1
> 
> $ ipvsadm -L -c -n |grep <client1>
> TCP 01:54  FIN_WAIT    <client1>:49598 152.2.210.46:80    192.168.2.2:80
> TCP 00:47  SYN_RECV    <client1:0      152.2.210.46:80    192.168.2.2:80

The entry for the connection has entered the FIN_WAIT state,
as expected, and the persistance template is ticking down.

> 3. Still loading new pages in the browser on the client.  Connection is
> reported as inactive, and the state switches to TIME_WAIT.
> 
> $ ipvsadm -L -n
> IP Virtual Server version 1.0.10 (size=65536)
> Prot LocalAddress:Port Scheduler Flags
>   -> RemoteAddress:Port           Forward Weight ActiveConn InActConn
> TCP  152.2.210.46:80 rr persistent 300
>   -> 192.168.2.2:80               Masq    1      0          1
> 
> $ ipvsadm -L -c -n |grep <client1>
> TCP 01:55  TIME_WAIT   <client1>:49598 152.2.210.46:80    192.168.2.2:80
> TCP 00:55  SYN_RECV    <client1>:0     152.2.210.46:80    192.168.2.2:80

I suspect that your web browser (Explorer?) is reopening the connection
(RFC 1122, 4.2.2.13), but that it is very short lived so you can't
observe what is going on. So basically the port 49598 connection is
swiching betweeen active and inactive, which is why you don't see the
inactive connection count grow.

> 4. It's not until the connection disappears from /proc/net/ip_vs_conn
> and the InActConn is decremented that a new connection from the same
> client causes an increment of the ActiveConn count.
> 
> Is this normal behavior for http services on ipvs?

I am not sure if this helps or not, but if a connection is in the
connection table (i.e. it shows up in ipvsadm -L -c -n), but is not a
persistance template (i.e. the client's port is not zero) then it will
be counted in either ActiveConn or InActConn. If the connection is in
the ESTABLISHED state then it is counted in ActiveConn, otherwise it is
counted in InActConn.

-- 
Horms
<Prev in Thread] Current Thread [Next in Thread>