LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

LVS (DR+SH) with UDP balancing odd?

To: lvs-users@xxxxxxxxxxxxxxxxxxxxxx
Subject: LVS (DR+SH) with UDP balancing odd?
From: Anders Henke <anders@xxxxxxxxxx>
Date: Wed, 19 Feb 2003 13:52:40 +0100
Hi,

we're happily using LVS (DR+wrr) for balancing load (http/http/soap as well
as an inhouse-designed session service) of currently four clusters with a 
total of around 45 realservers. 
As a central syslog server is not yet overloaded but wouldn't be useless 
to prepare some clustering, I thought about adding a balancer for syslog
services using the sourcehash scheduler (so that all logs of a distinct
host is only sent to exactly one realserver, easing file aggregation and
distribution a lot).

Problem:
-syslog is udp
-sh, rr and lc seem to balance tcp well, but udp performs somewhat
 unbalanced:

IP Virtual Server version 1.0.7 (size=4096)
Prot LocalAddress:Port Scheduler Flags
  -> RemoteAddress:Port           Forward Weight ActiveConn InActConn
UDP  172.21.0.2:514 sh
  -> 172.21.0.49:514              Route   1      0          6         
  -> 172.21.0.48:514              Route   1      0          3541      
TCP  172.21.0.2:101 sh
  -> 172.21.0.49:101              Route   1      0          7         
  -> 172.21.0.48:101              Route   1      0          4         

101/tcp is a test service, 514/udp the "real" syslog; test service was tried
from a few single machines, syslog is live-syslog from a few hundred 
different hosts. Not only sh but also rr and lc were tested - with the
same results.

Ok, according to ipvsadm-howto par 5.17 this is somehow expected:
"On a short time scale (ca. timeout), there will be no load balancing
of UDP services (e.g. as was found for ntp). All requests will go to 
the same realserver. On a long time scale (>>timeout) loadbalancing will 
occur."

In fact, on a long time scale (over the night) very few requests were sent 
to the second realserver; but as I reduced the timeout to a few seconds, the
load was distributed fine along the realservers:

IP Virtual Server version 1.0.7 (size=4096)
Prot LocalAddress:Port Scheduler Flags
  -> RemoteAddress:Port           Forward Weight ActiveConn InActConn
UDP  172.21.0.2:514 sh
  -> 172.21.0.49:514              Route   1      0          1174      
  -> 172.21.0.48:514              Route   1      0          1191      

From a 

# while /bin/sleep 1 ; do ipvsadm -Ln -c --sort | grep ${srchost}:514 ; done

packets are balanced to the same realserver for $srchost (for a couple
of hosts).

As the first test gave somehow strange results (balancing 99% to a single
host), I'd like to know if I can expect the balancer to work as sh is 
expected to do (really always balance by source-ip always to the same
realserver) or if somehow things might break up like they do when
having the udp-timeout at 300 seconds.


Regards,

Anders


<Prev in Thread] Current Thread [Next in Thread>
  • LVS (DR+SH) with UDP balancing odd?, Anders Henke <=