You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@synapse.apache.org by Chathura Ekanayake <cc...@gmail.com> on 2007/04/02 20:15:17 UTC
Re: Endpoints and load-balancing
Hi,
I have completed the synapse loadbalancing and failover implementation with
the addition of session affinity based load balancing.
So in addition to the loadbalancing syntax mentioned the configuration
language, load balancing endpoints can have a element
named <session type="soap | http | simpleClientSession"/>. The type
attribute specifies the session type, to which the load balancing
endpoints should be bound.
Currently it supports 3 session types as noted above.
1) SOAP sessions based on the service group ID
2) HTTP sessions based on HTTP cookies
3) simpleClientSession based on a SOAP header named "ClientID" set by the
client. This is added to demonstrate that loadbalancing
logic can bind sessions based on the content of the messages sent by the
client.
I have also added some samples to demonstrate this new functionality.
Sample 200 (synapse_sample_200.xml): configuration for simple load
balancing.
Sample 201: configuration for failover sending
Sample 202: configuration for simpleClientSession based load balancing
Sample 203: configuration for simpleClientSession based load balancing with
failover
Sample 204: configuration for HTTP session based load balancing
Sample 205: configuration for HTTP session based load balancing with
failover
To get a quick feeling of the new functionality, start synapse with one of
the above sample configurations and run either simple client or
multi threaded client pointing to synapse.
Below is a complete procedure for one scenario.
Extract synapse-1.0-RC1-SNAPSHOT-bin.tar.gz to a directory.
Go to synapse-1.0-RC1-SNAPSHOT/bin directory and run "sh synapse.sh -sample
200"
Go to synapse-1.0-RC1-SNAPSHOT/samples/axis2Server/src/LoadbalanceFailoverService
directory and run "ant" to build neccessary services.
Open synapse-1.0-RC1-SNAPSHOT/samples/axis2Server directory in a seperate
terminal and run "sh axis2server.sh -http 9001 -https 9005 -name Server1"
This will start a server on http port 9001 and gives it the name Server1
Similarly open two another terminals and run servers using
sh axis2server.sh -http 9002 -https 9006 -name Server2
sh axis2server.sh -http 9003 -https 9007 -name Server3
Now go to the synapse-1.0-RC1-SNAPSHOT/samples/axis2Client directory and run
"ant loadbalancefailover"
You can see how requests are distributed between Server1, Server2 and
Server3.
The multi threaded client can be used to run clients in multiple threads
pointing to the same EPR (e.g. Synapse or Axis2 Server).
So it can be used to compare the performance advantage of using the synapse
load balancing over directly invoking Axis2 server.
I will update the synapse samples documentation with the details of these.
Hope you will try this functionality and give ideas for improvement.
Thanks,
Chathura
Re: Endpoints and load-balancing
Posted by Chathura Ekanayake <cc...@gmail.com>.
Hi Rajith,
I think sample 200 (synapse_sample_200.xml), 201 and 205 will help you.
Sample 201 is just failover sending. So if we are using Axis2 clustering
with that we can keep only one node as the primary at a time.
We don't have to worry about concurrent access issues, but it's only for
high availability (not for scalability).
Sample 200 is state less load balancing. So either there should be no
sessions or all nodes have to be clustered with considering
the concurrent access issues.
Sample 205 would be the best fit. It binds failover groups to http sessions.
So we have cluster the nodes in failover groups using
the primary backup model.
Although the loadbalancing implementation supports service group ID based
sessions, there is an issue in Axis2 (
https://issues.apache.org/jira/browse/AXIS2-2404), which prevents soap
sessions from passing through Synapse. Therefore I didn't
include a sample with the soap session. Once this issue is resolved, setting
<session type="soap"/> would enable soap sessions.
Regards,
Chathura