You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@synapse.apache.org by Afkham Azeez <af...@gmail.com> on 2008/11/01 08:09:35 UTC

Re: Synapse Dynamic Load Balancer

Please see my answers inline

On Mon, Oct 27, 2008 at 11:52 AM, Hiranya Jayathilaka
<hi...@gmail.com>wrote:

> Hi Folks,
>
> I'm doing some R&D work on dynamic load balancing. While studying the
> dynamic load balancing features of Synapse I came across a few questions.
> Please help me to get these clarified.
>
> 1. How would the synapse configuration look like for a dynamic load balance
> scenario with multiple clustering groups/domains?


The DynamicLoadBalance endpoint will not be aware about the multiple groups.
It is the load balance algorithm that should look at the requested URL or
addressing headers and decide where to send the message to. i.e. to which
member in which group. So you will need to implement a group aware load
balancing algorithm

>
>
> 2. Axis2LoadBalanceMembershipHandler can store only one application domain
> value. Does that mean it cannot deal with multiple domains? In that case how
> does Synapse deals with multiple clustering domains?
>

I can change this to handle all groups, and the member will have a group
attribute. Depending on the group of each member, the load balancing
algorithm will categorize the members. This can be used to calculate where
the message needs to be sent to. It is the LoadBalanceMembershipHandler that
bridges Synpase & the underlying group communications framework's membership
mechanism. To bridge with Axis2, we have used
Axis2LoadBalanceMembershipHandler. To bridge with some other system, we will
need to implement another LoadBalanceMembershipHandler.

It should also be possible to define MembershipHandlers at the Synapse level
for different groups. I haven't tried this though. e.g in the synapse.xml,

          <send>
                <endpoint name="dynamicLB">
                    <dynamicLoadbalance failover="true"

algorithm="org.apache.synapse.endpoints.algorithms.RoundRobin">
                        <membershipHandler

class="org.apache.synapse.core.axis2.Axis2LoadBalanceMembershipHandler">
                            <property name="applicationDomain"
value="apache.axis2.app.domain1"/>
                        </membershipHandler>
                        <membershipHandler

class="org.apache.synapse.core.axis2.Axis2LoadBalanceMembershipHandler">
                            <property name="applicationDomain"
value="apache.axis2.app.domain2"/>
                        </membershipHandler>
                    </dynamicLoadbalance>
                </endpoint>
            </send>

>

> 3. It seems adding and removing nodes to a cluster under a particular
> domain is handled by the LoadBalanceEventHandler. Am I correct?
>

It is through the  LoadBalanceEventHandler that the Axis2 group
communications mechanism informs interested parties about membership changes
in each group. This is independent of Synapse. We can have multiple of these
for each domain. e.g. in the axis2.xml,

      <loadBalancer enable="true">
            <applicationDomain name="apache.axis2.app.domain1"

handler="org.apache.axis2.clustering.DefaultLoadBalanceEventHandler"/>
           <applicationDomain name="apache.axis2.app.domain2"

handler="org.apache.axis2.clustering.DefaultLoadBalanceEventHandler"/>
        </loadBalancer>


> 4. In case of the DefaultLoadBalanceEventHandler who notifies the class
> when members are needed to be added or removed? In other words who is
> responsible for firing off the events? Is this taken care of by the Axis2
> ClusterManager?
>

 DefaultLoadBalanceEventHandler is notified by the relevant Axis2 membership
manager when membership changes take place. This is independent of Synapse.

>
>
> Thanks
>
> Best Regards,
> Hiranya
>



-- 
Thanks
Afkham Azeez

Blog: http://afkham.org
Developer Portal: http://www.wso2.org
WSAS Blog: http://wso2wsas.blogspot.com
Company: http://wso2.com
GPG Fingerprint: 643F C2AF EB78 F886 40C9  B2A2 4AE2 C887 665E 0760