On Mon, Aug 15, 2005 at 10:53:23AM -0700, Joseph Mack NA3T wrote:
> On Mon, 15 Aug 2005, Jan Bruvoll wrote:
>
> >this server have all gone away is expected. However, since I issued the
> >command the number of active connections has actually increased,
>
> :-(
>
> You'll have to wait for Horms I'm afraid.
Hi,
This is a fairly simple problem, that is unfortunately difficult to
explain. Let me try:
When you set a real server to be quiescent (weight=0), this means that
no new connections will be allocated to that real server using the
scheduler. However, if you have persistance in effect (which you do),
and a new connection is recieved from a end-user that recently made a
connection, then that connection will be allocated to the same
real server as the previous connection. The trick is, this process
by-passes the scheduler, and thus by-passes quiescence.
So, for a persistant service a new connection is processed a bit like this:
if (same end-user as a recent connection)
use the real-server of that connection
else
choose non-quiecent real-server using scheduler
Obviously this is a bit of a problem, for the reason you describe in
your email. In implementation terms the problem is that when
a connection for a persistant service is scheduled, a persistant
template is created, with a timeout of the persitant timeout.
This template is then used to select the real-server for
subsequent connections from the same end-user. It stays
in effect until its timeout expires. And its timeout is
renewed everytime a packet is recieved for an associated
connection. Which means in the case of quiesence, as long
as end-users that have active persistance templates keep
connecting or sending packaets within the persistance timeout,
the real-server will keep having connections.
The solution to this is quite simple. The patch at the URL below, which
has been included in recent kernel versions, adds
expire_quiescent_template to proc. By default it is set to 0, which
gives the behaviour discribed above, the historical behaviour of LVS
(which I might add can be desirable in some situations). However, if you
set it to 1, then connection templates associated with a quiesced
real-server are expired, at lookup time. Which, in a nutshell means
that the "if" condition above will always fall through the the "else"
clause, and thus quiescence is not by-passed.
To effect this change just run the following as root
echo 1 > /proc/sys/net/ipv4/vs/expire_quiescent_template
The change effect new connections immediately.
Or, on systems that have sysctl, add the folloging to /etc/sysctl.conf
and run sysctl -p net/ipv4/vs/expire_quiescent_template= 1
This will also take effect immediately, and has the advantage that
the change will be persistant across reboots.
http://archive.linuxvirtualserver.org/html/lvs-users/2004-02/msg00224.html
--
Horms
|