LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

Re: [lvs-users] Persistent connections

To: Tracy Reed <treed@xxxxxxxxxxxxxxx>
Subject: Re: [lvs-users] Persistent connections
Cc: lvs-users@xxxxxxxxxxxxxxxxxxxxxx
From: Simon Horman <horms@xxxxxxxxxxxx>
Date: Sun, 4 Jul 2010 20:17:07 +0900
On Fri, Jul 02, 2010 at 01:01:19PM -0700, Tracy Reed wrote:
> Hello all,
> 
> We are using LVS with the Piranaha GUI that comes with CentOS 5.4. I
> have a couple of questions:
> 
> We have a few VIPs configured, some of which use persistence. But the
> output of --persistent-conn doesn't make any sense to us.
> 
> rr.mydomain.com is our very busy load balanced web app. PersistConn
> shows 0. But webmail.mydomain.com is our very lightly loaded webmail
> cluster. It gets maybe an access every 30 minutes. With a persistence
> timeout of 3600 4 and 6 might make some sense. But 0 for rr makes no
> sense at all. 0 active connections for dbro and dbrw makes no sense
> also. I have a connection to it right now and it still shows zero.
>
> [root@dblvs1 ~]# /sbin/ipvsadm --list --persistent-conn
> IP Virtual Server version 1.2.1 (size=4096)
> Prot LocalAddress:Port            Weight    PersistConn ActiveConn InActConn 
>   -> RemoteAddress:Port
> TCP  rr.mydomain.com:htt wlc persistent 7500
>   -> rr1.mydomain.com:ht 1         0           0          0         
>   -> rr2.mydomain.com:ht 1         0           0          0         
> TCP  webmail.mydomain.co wlc persistent 3600
>   -> webmail2.mydomain.c 1         4           0          0         
>   -> webmail1.mydomain.c 1         6           0          0         
> TCP  rr.mydomain.com:htt wlc persistent 7500
>   -> rr2.mydomain.com:ht 1         0           0          0         
>   -> rr1.mydomain.com:ht 1         0           0          0         
> TCP  dbro.mydomain.com:m wlc
>   -> db3.mydomain.com:my 1         0           0          0         
> TCP  dbrw.mydomain.com:m wlc
>   -> db1.mydomain.com:my 1         0           0          0         

That is rather a lot of zeros.

I wonder if there is just a but in the reporting code.
Is the result from ipvsadm -Lcn also empty? If so,
then I'd start to suspect that your connections aren't
going through the linux-director in question.

> Another weird thing is that with wlc (the default, at least when
> configured with piranha) we generally only see traffic being sent to
> rr1 and very rarely to rr2. Is this normal? I have a hunch "weighted
> least connections" means traffic goes to whichever machine has the
> fewest connections but when they both have zero it would be nice for
> my developer's confidence in lvs if it fell back to round robin
> instead of all going to the same machine. We could just use roundrobin
> but as long as the persistence and active connection numbers aren't
> making sense we wanted to stick with as close to a default config
> as possible until we figure that out.

That isn't really the expected behaviour, unless there is a rather
long time between connections. The reason being, that the "business"
is calculated using ActiveConn * 8 + InActConn. So if a real-server
has recently had a connection, even if it is closed, it will be
"busier" than a real-server that hasn't had any connections recently.

So even though the wlc code doesn't explicitly include rr, in practice
it ought to provide rr if there are sequential connections and nothing
else going on.

> Also note that rr.mydomain.com appears twice because one is http and
> the other is https. Are there any problems with running two pools of
> servers on the same IPs but on different ports? It seems like it
> should work to me but someone here has questioned whether that might
> somehow be confusing our connections numbers.

It should work fine.


_______________________________________________
Please read the documentation before posting - it's available at:
http://www.linuxvirtualserver.org/

LinuxVirtualServer.org mailing list - lvs-users@xxxxxxxxxxxxxxxxxxxxxx
Send requests to lvs-users-request@xxxxxxxxxxxxxxxxxxxxxx
or go to http://lists.graemef.net/mailman/listinfo/lvs-users

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