LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

Re: [lvs-users] LVS with Weighted Least-Connection Scheduling

To: "LinuxVirtualServer.org users mailing list." <lvs-users@xxxxxxxxxxxxxxxxxxxxxx>
Subject: Re: [lvs-users] LVS with Weighted Least-Connection Scheduling
From: "Sebastian Krueger" <sebykrueger@xxxxxxxxx>
Date: Thu, 21 Feb 2008 16:48:56 +1300
Joe,

I checked out persistent=1 and from the man page of ldirectord I find this:

----------
persistent = n

Number of seconds for persistent client connections.
----------

So it wouldn't be that I think.

fwmark sounds interesting, I will google about that one in a moment to find
out.

Guy,

>>
>> However, unfortunately traffic is assigned to an arbitrary real server
for
>> each virtual server if there are no other connections already
established.
>
>Yes - presumably the LVS director is load-balancing requests between the
>three real servers. The weights probably only come into it once there
>are a few connections happening.

I have a feeling you might be right. Maybe I'll end up having to change the
scheduling algorithm myself to include the weights if no clients are
connected.

What I'm trying to achieve is to load-balance Java Message Service (JMS)
connections.

So we have multiple JMS clients and multiple JMS servers. LVS does the
load-balancing
based on IP address affinity, so in order to load-balance a single JMS
client across many
JMS virtual servers the solution was to create multiple virtual servers and
have the
JMS client round-robin over all the available JMS virtual servers.

Currently these are set to 3, but the LVS configuration could easily be
extended to

virtual=10.32.30.125:18007
        real=192.168.0.10:18007 masq 10
        real=192.168.0.20:18007 masq 5
        real=192.168.0.30:18007 masq 5
        real=192.168.0.40:18007 masq 5
        real=192.168.0.50:18007 masq 5
        real=192.168.0.60:18007 masq 5
virtual=10.32.30.125:18008
        real=192.168.0.10:18007 masq 5
        real=192.168.0.20:18007 masq 10
        real=192.168.0.30:18007 masq 5
        real=192.168.0.40:18007 masq 5
        real=192.168.0.50:18007 masq 5
        real=192.168.0.60:18007 masq 5

So now a single JMS client can load-balance itself across 2 virtual servers
and many
JMS clients are load-balanced across all real-servers so the over-all load
is
nicely spread across all real servers.

So let's say a single JMS client connects to both virtual JMS servers.
If no other clients are connected, he will be scheduled to
the real server on 192.168.0.10 on both virtual servers. This is because LVS
chooses the first real server regardless of the weighting if there are no
existing
connections.

However, since each received JMS message means a huge amount of processing,
it is important that each request goes to different real servers (as much
as possible).

Is there anyone out there that has ever tried to use LVS for JMS
connections?

Thanks for your help!

Regards, Sebastian.

On Thu, Feb 21, 2008 at 3:50 PM, Guy Waugh <gwaugh@xxxxxxxxxx> wrote:

> Hi Sebastian,
>
> Sebastian Krueger wrote:
> > Hi everyone,
>
> <snip>
>
> > Notice how I have given each virtual server a different weighting for
> the
> > real servers. My aim was that if each virtual server has a single
> distinct
> > client connected, then they would all be balanced to different real
> servers.
> > Based on the weightings specified above.
>
> Are you saying that there will only ever be 3 distinct clients
> connected, and you want each of them to be balanced to a separate real
> server?
>
> If so, you must be pointing each client at their own virtual service
> address, so you may as well do away with LVS altogether and just point
> them at their own real server directly.
>
> If not, just use one virtual service, load-balanced between your three
> real servers equally (i.e. each real server has equal weight), but
> consider using a persistence value, so that each client will 'stay' with
> a real server for a certain amount of time... like this:
>
> virtual=10.32.30.125:18007
>         real=192.168.0.10:18007 masq 1
>          real=192.168.0.20:18007 masq 1
>         real=192.168.0.30:18007 masq 1
>         checktype=on
>         virtualhost=eaivcon3.kdc.ird.govt.nz
>         scheduler=wlc
>          persistent=600
>          protocol=tcp
>         checkport=18001
>         service=http
>         request="/PingWebClient/pingApp.jsp"
>         receive="REPOUT"
>
> ... or then again, perhaps I am missing what you are getting at entirely
> 8-)
>
> >
> > However, unfortunately traffic is assigned to an arbitrary real server
> for
> > each virtual server if there are no other connections already
> established.
>
> Yes - presumably the LVS director is load-balancing requests between the
> three real servers. The weights probably only come into it once there
> are a few connections happening.
>
> Regards,
> Guy.
>
> >
> > Has anyone found a way around this?
> >
> > Regards, Sebastian.
> > _______________________________________________
> > 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
>
>
> _______________________________________________
> 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>