You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by Simon Laws <si...@googlemail.com> on 2008/04/30 14:56:45 UTC

Load balancing demo

I've just committed a load balancing demo I've had knocking around for a bit
[1]. It balances HTTP based service calls across tomcat servers configured
with an SCA enabled webapp. It's a work in progress and there are a couple
of points I need some help with....

1 - There are currently manual steps involved in getting it running.

I set it up using the fairly well trodden Apache -> mod_jk -> Tomcat route.
I've automated the creation and configuration of the tomcat instances but
obviously doing the same for Apache is more tricky. Thinking I was being
smart this week I replaced Apace with the old "balancer" webapp from tomcat
5 days and wrote a round robin rule. However this all fell apart as the
balancer webapp is based on HTTP redirects and Axis2 doesn't handle them.
Had this worked I had a completely Java demo and I could run the whole thing
automatically.

So any thoughts on either A) how to automate Apache installs B) a tomcat
based load balancer.

2 - I'm planning to upgrade the app to make it one part of a distributed
domain. In particular I want to demonstrate how to configure the nodes in
the cloud to reference the tomcat cluster generally rather than the
individual node as logically a composite is deployed to a cluster rather
than all the nodes in a cluster. A conversation has started [2] about what a
webapp means in a distributed domain so comments on that thread would be
useful to this exercise also.

Regards

Simon

[1]
http://svn.apache.org/repos/asf/incubator/tuscany/java/sca/demos/load-balancing-webapp/
[2] http://www.mail-archive.com/tuscany-dev%40ws.apache.org/msg31031.html

Re: Load balancing demo

Posted by Simon Laws <si...@googlemail.com>.
On Wed, Apr 30, 2008 at 3:05 PM, ant elder <an...@apache.org> wrote:

> On Wed, Apr 30, 2008 at 2:44 PM, Simon Laws <si...@googlemail.com>
> wrote:
>
> > On Wed, Apr 30, 2008 at 2:00 PM, ant elder <an...@gmail.com> wrote:
> >
> > > On Wed, Apr 30, 2008 at 1:56 PM, Simon Laws <simonslaws@googlemail.com
> >
> > > wrote:
> > >
> > > <snip>
> > >
> > > However this all fell apart as the
> > > > balancer webapp is based on HTTP redirects and Axis2 doesn't handle
> > > them.
> > > > Had this worked I had a completely Java demo and I could run the
> whole
> > > > thing
> > > > automatically.
> > > >
> > > > So any thoughts on either A) how to automate Apache installs B) a
> > tomcat
> > > > based load balancer.
> > > >
> > > >
> > > How about also C) how to fix Axis2 to handle redirects? Is it some
> > > fundamental problem or just a bug which we could try to fix?
> > >
> > >   ...ant
> > >
> >
> > I didn't consider C) base on this post
> > http://www.mail-archive.com/axis-dev@ws.apache.org/msg33803.html
> >
> > Simon
> >
>
> Ok, and the JIRA that was raised from that is
> http://issues.apache.org/jira/browse/AXIS2-2809. Not sure I agree it
> shouldn't be supported though so it may be worth reopening that. There's
> the
> case when WS-Addressing is not being used, and even if it is then it
> should
> be possible to just update the WSA TO header while processing the
> redirect.
> There's some doc on how to support redirects with the http client that
> axis2
> uses at http://hc.apache.org/httpclient-3.x/redirects.html. Note that CXF
> does support redirects, see the client AutoRedirect option -
> http://cwiki.apache.org/CXF20DOC/client-http-transport.html.
>
> Still, seems like your options A or B may be quicker to get done :)
>
>
>   ...ant
>

You may be right that it's a sensible thing for Axis to do. However my
adoption of the old tomcat balancer webapp and hence the redirect approach
was really a hack to allow me to fire all this up automatically. Had it
worked I would have put a big banner in the README saying don't set your
load balancing up like this and pointing off to how to do it with Apache.
You wouldn't run really load balancing like this. Indeed the balancer webapp
is no longer shipped with tomcat 6. Hence  It's not sensible to chase a
change through Axis just to get a hack to work for us that makes a demo
easier.

As it turns out it the hack doesn't work so we are forced to do it properly
(ish). This is probably better in the long run as we don't have to explain
why people should do as we say and not as we do.

Simon

Re: Load balancing demo

Posted by ant elder <an...@apache.org>.
On Wed, Apr 30, 2008 at 2:44 PM, Simon Laws <si...@googlemail.com>
wrote:

> On Wed, Apr 30, 2008 at 2:00 PM, ant elder <an...@gmail.com> wrote:
>
> > On Wed, Apr 30, 2008 at 1:56 PM, Simon Laws <si...@googlemail.com>
> > wrote:
> >
> > <snip>
> >
> > However this all fell apart as the
> > > balancer webapp is based on HTTP redirects and Axis2 doesn't handle
> > them.
> > > Had this worked I had a completely Java demo and I could run the whole
> > > thing
> > > automatically.
> > >
> > > So any thoughts on either A) how to automate Apache installs B) a
> tomcat
> > > based load balancer.
> > >
> > >
> > How about also C) how to fix Axis2 to handle redirects? Is it some
> > fundamental problem or just a bug which we could try to fix?
> >
> >   ...ant
> >
>
> I didn't consider C) base on this post
> http://www.mail-archive.com/axis-dev@ws.apache.org/msg33803.html
>
> Simon
>

Ok, and the JIRA that was raised from that is
http://issues.apache.org/jira/browse/AXIS2-2809. Not sure I agree it
shouldn't be supported though so it may be worth reopening that. There's the
case when WS-Addressing is not being used, and even if it is then it should
be possible to just update the WSA TO header while processing the redirect.
There's some doc on how to support redirects with the http client that axis2
uses at http://hc.apache.org/httpclient-3.x/redirects.html. Note that CXF
does support redirects, see the client AutoRedirect option -
http://cwiki.apache.org/CXF20DOC/client-http-transport.html.

Still, seems like your options A or B may be quicker to get done :)


   ...ant

Re: Load balancing demo

Posted by Simon Laws <si...@googlemail.com>.
On Wed, Apr 30, 2008 at 2:00 PM, ant elder <an...@gmail.com> wrote:

> On Wed, Apr 30, 2008 at 1:56 PM, Simon Laws <si...@googlemail.com>
> wrote:
>
> <snip>
>
> However this all fell apart as the
> > balancer webapp is based on HTTP redirects and Axis2 doesn't handle
> them.
> > Had this worked I had a completely Java demo and I could run the whole
> > thing
> > automatically.
> >
> > So any thoughts on either A) how to automate Apache installs B) a tomcat
> > based load balancer.
> >
> >
> How about also C) how to fix Axis2 to handle redirects? Is it some
> fundamental problem or just a bug which we could try to fix?
>
>   ...ant
>

I didn't consider C) base on this post
http://www.mail-archive.com/axis-dev@ws.apache.org/msg33803.html

Simon

Re: Load balancing demo

Posted by ant elder <an...@gmail.com>.
On Wed, Apr 30, 2008 at 1:56 PM, Simon Laws <si...@googlemail.com>
wrote:

<snip>

However this all fell apart as the
> balancer webapp is based on HTTP redirects and Axis2 doesn't handle them.
> Had this worked I had a completely Java demo and I could run the whole
> thing
> automatically.
>
> So any thoughts on either A) how to automate Apache installs B) a tomcat
> based load balancer.
>
>
How about also C) how to fix Axis2 to handle redirects? Is it some
fundamental problem or just a bug which we could try to fix?

   ...ant