LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

Re: [lvs-users] Clear hash table

To: Petr Vyhnal <rudiik@xxxxxxxxxxxx>
Subject: Re: [lvs-users] Clear hash table
Cc: lvs-users@xxxxxxxxxxxxxxxxxxxxxx, Michael Maxim <mike@xxxxxxxxxxx>, Simon Horman <horms@xxxxxxxxxxxx>
From: Julian Anastasov <ja@xxxxxx>
Date: Sun, 24 Feb 2019 15:37:22 +0200 (EET)
        Hello,

On Wed, 20 Feb 2019, Petr Vyhnal wrote:

> I'm using IPVS with source hashing mechanism for UDP syslog traffic. I 
> also have sh-fallback defined. There are two real servers configured and 
> it work perfectly - events are balanced per source IP and when one goes 
> down, all syslog events are shifted to the remaining one. The problem is 
> when failed server comes back up, because all syslog events keep to be 
> delivered to the one which was online all the time. This makes one real 
> server constantly loaded, while other is not utilized almost at all. 
> Yes, few new events are delivered to the second real server, but 
> majority of events is still pointed to the first one. Hence I'd like to 
> find a way how to manually clear hash table to force IPVS to recreate 
> hash table to re-balance traffic between both available real servers. 
> Any idea how to do that? So far I can only achieve that by rebooting the 
> server which is not something I'd like to do on common basis.

commit 76ad94fc5df8 ("IPVS: Modify the SH scheduler to use weights") added
support for weights to SH but its fallback strategy suffers when server's
weight is changed to 0. May be we can help it by using the more recent
addition of dest->last_weight. This will allow change of weight to 0 to
not affect the distribution of dests in SH table. As result, marking one
server as unavailable will not change the distribution. But one should 
prefer the MH scheduler when fallback is used.

        For your setup the real problem is probably the reuse of existing
connections. It can happen for any scheduler. May be you should consider
using the -o flag (--ops) which enables OPS mode (One-packet scheduling)
for the virtual service. It ensures that every packet passes via the
scheduler. By default, without --ops, packets are treated as part of
connection and sent to same backend server, the scheduler is used only
when no existing connection is found.

Regards

--
Julian Anastasov <ja@xxxxxx>

_______________________________________________
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>