Having client of Squid server with opened persistent connection
causing the LVS balancing forwarding new connections to the other node
only.

LVS configuration and status:
~ $ ipvsadm -Ln
IP Virtual Server version 1.2.1 (size=4096)
Prot LocalAddress:Port Scheduler Flags
  -> RemoteAddress:Port           Forward Weight ActiveConn InActConn
TCP  10.x.y.55:3128 lblcr
  -> 10.x.y.50:3128              Route   1      26         440
  -> 10.x.y.51:3128              Route   1      1          0

Once the Squid on 51 node is restarted, the connections are
distributed via both nodes again. After "some time" only one
connection remain opened/active via 51 node. Always caused by the same
client opening HTTP persistent connection to specific domain.
Running on updated Debian9.
~ $ uname -a
Linux proxy01 4.9.0-5-amd64 #1 SMP Debian 4.9.65-3+deb9u2 (2018-01-04)
x86_64 GNU/Linux

Change of weight to 20 caused all the connections going through both nodes.
~ $ ipvsadm -Ln
IP Virtual Server version 1.2.1 (size=4096)
Prot LocalAddress:Port Scheduler Flags
  -> RemoteAddress:Port           Forward Weight ActiveConn InActConn
TCP  10.x.y.55:3128 lblcr
  -> 10.x.y.50:3128              Route   20     21         248
  -> 10.x.y.51:3128              Route   20     25         42

Seems that opening 20 persistent connections via one node will cause
the similar behavior like with one connection and weight set to one.

With weight of 200 set on both nodes, all connections were forwarded
to one node only.

How to understand the weight for lblcr scheduler? What is the best
practice for balancing persistent connections?
According the LVS How-to [1], setting the LVS persistence for VIP
might help to let LVS forward connections across all nodes
independently on weight value. Is this my assumption correct?

[1] 
http://www.austintek.com/LVS/LVS-HOWTO/HOWTO/LVS-HOWTO.persistent_connection.html

-- 
Peter

_______________________________________________
Please read the documentation before posting - it's available at:
http://www.linuxvirtualserver.org/

LinuxVirtualServer.org mailing list - lvs-users@LinuxVirtualServer.org
Send requests to lvs-users-requ...@linuxvirtualserver.org
or go to http://lists.graemef.net/mailman/listinfo/lvs-users

Reply via email to