LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

Re: clearing persistent connections

To: "LinuxVirtualServer.org users mailing list." <lvs-users@xxxxxxxxxxxxxxxxxxxxxx>
Subject: Re: clearing persistent connections
From: Horms <horms@xxxxxxxxxxxx>
Date: Mon, 28 Mar 2005 12:59:11 +0900
On Fri, Mar 25, 2005 at 04:51:37PM +0100, jos houtman wrote:
> Hello List,
> 
> We are using the lvs to loadbalance about 30 webservers.
> We use the Direct Routing architecture.
> 
> We have also setup a monitor service (using mon) to monitor the servers for
> database replication problems or http problems and remove them from the 
> load balancer if necessary.
> 
> _CURRENT SITUATION_
> our current setup is that first the weight gets set to 0, and after some 
> time it is removes from the cluster.
> This all is to give the server some time to breath and catch up.
> If it comes back up, mon will put it in the loadbalancer again.
> 
> But now, if we want to maintain a server, we will remove it from the 
> loadbalancer.
> wreck havoc on the server, so that mon will detect that it doesnt work.
> if at sometime mon will detect that it is working again and put it in 
> the loadbalancer.
> Which is not what i want, because i was still working on it.
> 
> _WANTED SITUATION_
> so what I want to do, is let mon put the weight to 0. and after a while 
> clear the active persistent connections.
> So that it is effectively out of the cluster.
> if it comes back up, mon can put the weight back to 1.
> 
> But if i decide to maintain a server, i can take it out of the cluster 
> (-d).
> and mon can try what it want to put the weight back to 1. but the server 
> wont be there.

Won't mon only re-add it if it is there?

> another advantage is that i can see which servers are not working in the 
> cluster because there weight is 0.

Basically 0 is a magic weight that means the server is quiescent.
In the past I have thought about using a different magic weight (-1 ?)
to put a real-server into the same state it would be if it was deleted,
that is kill all exising connections and not accept any new ones.
It would probably be cleaner to add some meta-data to the real-server
and stop overloading the weight. But in any case an I think adding
such a feature, (called idle?) would resolve your problem. And
you are not the first person who has wanted offline servers
to be listed in the table.

Annother approach, as you suggest, is to just clear the connections.
Which...

> Since i can allready hear you ask the question i will answer it now :)
> why i dont want to edit the mon config?
> Because each server represents about 30 lines of config, and its alot of 
> work to comment that :( .
> 
> So is there a way to clear the active persistent connections of a server?

... you could achive this by removing the real-server and re-adding
it with a 0 weight. But it might be nicer just to pass an
argument to ipvsadm (--clear, --kill-conn?) which just askes LVS
in the kernel to run through the active connections and close them.

-- 
Horms

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