LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

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

To: "LinuxVirtualServer.org users mailing list." <lvs-users@xxxxxxxxxxxxxxxxxxxxxx>
Subject: Re: [lvs-users] Problem with Least-connection scheduling and MySql
From: Christian Frost <chrfrost@xxxxxxxxx>
Date: Tue, 05 May 2009 10:34:12 +0200
Joseph Mack NA3T wrote:
> On Mon, 4 May 2009, Christian Frost wrote:
>
>   
>> 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.
>>     
>
> I assume you're using the same kernels etc...
>
> For LVS-DR the number displayed for ActiveConn, InActConn is 
> completely fabricated (based on expected tcpip timings), 
> since the director doesn't see the return packets. Changing 
> the director kernel from 2.4.x to 2.6.x results in dramatic 
> changes in these numbers, when there is no change in the 
> realservers. Still I would expect you'd get about the same 
> numbers if the software was the same on all machines, even 
> if the numbers aren't an accurate reflection of the state of 
> the realservers.
>
> When you get the unbalanced situation below, what's 
> happening on the realservers? Do they have the same number 
> of connections, loadaverage....?
>
>   
Yes we are using the same kernels on all machines, 2.6.
The connections are not balanced on the the MySQL realservers. The number of 
active connections shown in ipvsadm approximately corresponds to the number of 
threads created in MySQL. (SHOW GLOBAL STATUS) 

>> 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
>>     
>
> what does sequentially mean? One at a time and wait till the 
> client disconnects?
>   
Sequentially meant that connections are made with a short time interval.
> Joe
>
>   
>> 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
>>
>>     
>
>   


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