Re: load balancing problem
"Herta Van den Eynde" <[email protected]> Tue, 22 May 2007 00:28:50 +0200
| Newsgroups | gmane.linux.redhat.piranha |
|---|---|
| Message-ID | <[email protected]> |
On 21/05/07, Mohamed HADROUJ (Gmail) <[email protected]> wrote: > Hi, > when entring the following command : ipvsadm -L -c -nI I get this result : > > IPVS connection entries > pro expire state source virtual destination > UDP 04:57 UDP 10.11.11.225:32875 10.11.11.230:1812 > 10.11.11.19:1812 > > Every request sets the counter to 5:00 > Thank you for your help > > > On 5/21/07, Mohamed HADROUJ (Gmail) <[email protected]> wrote: > > I think also it's a persistence issue, because when i tried ipvsadm after > few minutes, the InActConn is initialized to 0. then the load balancer sends > the incoming request to the other server. here is an example : > > -I try to send several request : they all get answers but from the same > server > > -> RemoteAddress:Port Forward Weight ActiveConn InActConn > > UDP 10.11.11.230:radius wrr > > -> 10.11.11.20:radius Masq 1 0 0 > > -> 10.11.11.19:radius Masq 1 0 1 > > > > after few minutes : > > -> RemoteAddress:Port Forward Weight ActiveConn InActConn > > UDP 10.11.11.230:radius wrr > > -> 10.11.11.20:radius Masq 1 0 0 > > -> 10.11.11.19:radius Masq 1 0 0 > > > > and then all the requests coming to the load balancer are routed to the > other server : > > -> RemoteAddress:Port Forward Weight ActiveConn InActConn > > UDP 10.11.11.230:radius wrr > > -> 10.11.11.20:radius Masq 1 0 1 > > -> 10.11.11.19:radius Masq 1 0 0 > > > > How to fix this behaviour ? > > > > Regards, > > > > > > > > > > On 5/21/07, Herta Van den Eynde <[email protected]> wrote: > > > On 21/05/07, Mohamed HADROUJ (Gmail) <[email protected]> wrote: > > > > Hi All, > > > > I have some load balancing troubles using lvs/piranha, here is the > > > > description : > > > > when i use the ipvsadm command to view the statistics here what i get > : > > > > IP Virtual Server version 1.0.8 (size=65536) > > > > Prot LocalAddress:Port Scheduler Flags > > > > -> RemoteAddress:Port Forward Weight ActiveConn InActConn > > > > UDP 10.11.11.230:radius wrr > > > > -> 10.11.11.20:radius Masq 1 0 0 > > > > -> 10.11.11.19:radius Masq 1 0 1 > > > > > > > > the load balancer keeps forwarding the request to only one server. in > > > > addition of that the counter of the connection established is always > equal > > > > to 1. > > > > i've checked also in /var/log/messages, both servers are seen as > available. > > > > here is my config file : > > > > > > > > backup_active = 1 > > > > backup = 10.11.11.229 > > > > backup_private = 10.11.11.121 > > > > heartbeat = 1 > > > > heartbeat_port = 539 > > > > keepalive = 6 > > > > deadtime = 18 > > > > network = nat > > > > nat_router = 10.11.11.122 bond0.499:1 > > > > debug_level = NONE > > > > virtual gw_radius { > > > > active = 1 > > > > address = 10.11.11.230 bond0.498:1 > > > > port = 1812 > > > > send_program = "radpwtst -s %h -noacct -noauth -auth_port 1812 > > > > -secret mysecret -status" > > > > expect = "OK" > > > > use_regex = "0" > > > > #load_monitor = uptime > > > > scheduler = wrr > > > > protocol = udp > > > > timeout = 6 > > > > reentry = 15 > > > > quiesce_server = 0 > > > > server GW_1 { > > > > address = 10.11.11.19 > > > > active = 1 > > > > weight = 1 > > > > } > > > > server GW_2 { > > > > address = 10.11.11.20 > > > > active = 1 > > > > weight = 1 > > > > } > > > > server GW_3 { > > > > address = 10.11.11.21 > > > > active = 0 > > > > weight = 1 > > > > } > > > > } > > > > > > > > > > > > > > > > Thank you for your help > > > > Regards > > > > > > Might be a persistence issue. Did you try connecting from 2 different > > > nodes/PCs? > > > > > > Kind regards, > > > > > > Herta Mohamed, it looks like you posted an extract from the lvs.cf instead of the full file. Would you please look whether you have an entry "persistent = some value" in the "virtual gw_radius" part? If not, try adding a "persistent = 0". Note that depending on what's behind the load balancer, persistence may actually be what you need (in which case you could add e.g. "persistent = 18000", where the value equals 18000 seconds, or 5 hours). Also, in real life, when using persistence, ipvsadm may not show perfect balancing (e.g. people behind proxy servers will all connect from the same address, and therefore get connected to the same server, or some people may stay connected far longer than others). As long as the connections are reasonably spread out, you should be OK. Kind regards, Herta