LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

RE: A new load balancing algorithm for discussion and consideration

To: marko@xxxxxxxxxx,<lvs-users@xxxxxxxxxxxxxxxxxxxxxx>
Subject: RE: A new load balancing algorithm for discussion and consideration
From: Wensong Zhang <wensong@xxxxxxxxxxxx>
Date: Thu, 8 May 2003 22:18:42 +0800 (CST)

Hi,

On Wed, 7 May 2003, Marko Buuri wrote:

> 
> So, WLC does not include the incoming job for its cost function. Now I
> must ask why this design choice came to be? After all, what is
> calculated is an estimation of response time for that job. But the WLC
> cost function calculates the value from system state before the
> allocation of the job, not after which of course is what really matters.
> This is why the classic SED policy I described earlier has the increment
> of 1 in the cost function.
> 
> Consider this example: a server with W1=2 and a server twice as fast
> with W2=4. The former has C1=1 and the latter C2=2. So WLC cost function
> returns 0.5 for both servers, as if both were as good choices. An
> additional comparison of W is needed to determine which server actually
> is a better selection. I don't know if the implementation of WLC does
> this comparison or selects either one randomly?
> 
> The SED cost function however immediately returns 1 for the former and
> 0.75 for the latter server and thus describes better the states after
> the job would be located on these servers. One would imagine that
> implementation of latter algorithm would be more efficient because it
> seems to come down to an addition vs. a comparison loop.
> 
> Also consider this example: two servers with jobs/weight of 1/1 and
> 11/10. WLC policy will select the former server. SED policy sees it as
> 2/1 = 2.0 vs. 12/10 = 1.2 thus the latter is chosen while it is expected
> to produce better response time for the job.
> 

Yes, it is interesting that SED considers the new incoming job in the cost 
function to estimate the possible response time, and selects the server of 
short expected delay. Your examples make clear the difference between SED 
and WLC, thanks!

However, for scheduling a service (such as http) that there are a large 
number of small jobs and each server may have hundreds of active 
connections, the scheduling result between SED and WLC may be minimal. For 
scheduling big jobs, SED may outperform WLC.

> If WLC would adopt cost function like SED, then the I would recommend NQ
> policy modification to be added as well.
> 

I will probably not replace the cost function in WLC with the SED, but can
add new scheduling algorithms like SED and NQ in the LVS. Let users choose
which scheduling algorithm they want to use. Maybe some users use LVS to
schedule big jobs, they can choose NQ or SED.

Regards,

Wensong

<Prev in Thread] Current Thread [Next in Thread>