LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

[lvs-users] Problem with Least-connection scheduling and MySql

To: lvs-users@xxxxxxxxxxxxxxxxxxxxxx
Subject: [lvs-users] Problem with Least-connection scheduling and MySql
From: Christian Frost <chrfrost@xxxxxxxxx>
Date: Mon, 04 May 2009 10:31:59 +0200
Hi,
We have a setup including two real servers each of which runs an 
instance of MySql with the max_connections option set to 1000. In this 
setup we have run some performance tests with mysqlslap two determine 
the throughput of the setup. These tests involve simulating many 
simultaneous users querying the database. Under these conditions we have 
encountered some problems with the load balancer. Specifically, using 
ipvsadm -L -n to monitor the connections during the performance test 
there are intitially many connections represented as inactive. After a 
few seconds the inactive connections are represented as active in the 
respective real server. This causes a problem when the Least-Connection 
Scheduling algorithm is used because the connections are not equally 
between the two real hosts. The two real hosts are almost equal in terms 
of processing capacities.

In the following the output of ipvsadm -L -n is shown which probably 
explains the problem better.

ipvsadm -L -n a few seconds in the test simulating 200 MySql clients 
connecting simultaneously.

IP Virtual Server version 1.2.1 (size=4096)
Prot LocalAddress:Port Scheduler Flags
  -> RemoteAddress:Port           Forward Weight ActiveConn InActConn
TCP  10.0.1.5:3306 lc
  -> 10.0.1.2:3306                Route   1      71         0
  -> 10.0.1.4:3306                Route   1      70         60


ipvsadm -L -n after 30 seconds in the test simulating 200 MySql clients 
connecting simultaneously. Note that the load balancer uses the 
Least-Connection scheduling algorithm.

IP Virtual Server version 1.2.1 (size=4096)
Prot LocalAddress:Port Scheduler Flags
  -> RemoteAddress:Port           Forward Weight ActiveConn InActConn
TCP  10.0.1.5:3306 lc
  -> 10.0.1.2:3306                Route   1      71         0
  -> 10.0.1.4:3306                Route   1      130        0


The problem does not occur if the connections are made sequentially and 
if the number of total connections is below about 100.

Is there anything we can do to avoid these problems?

Best regards


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