axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Horia <a.ho...@gmail.com>
Subject [Axis2] load balancing attempts
Date Wed, 09 Feb 2011 09:13:33 GMT
Hi all,

I am attempting to have my Axis2 web service to work in a load balanced
environment. For this reason, I have tested with both mod_jk and mod_proxy
modules and with Tomcat clustering.

Using the mod_proxy module, as an alternative to mod_jk:

<IfModule mod_proxy.c>
<Proxy balancer://mycluster>
 BalancerMember ajp://localhost:8009 route=worker1
BalancerMember ajp://localhost:8019 route=worker2
 ProxySet lbmethod=byrequests
</Proxy>
 ProxyPass / balancer://mycluster/ stickysession=JSESSIONID
</IfModule>

Enabled the session management at the application level:

stub._getServiceClient().getOptions().setManageSession(true);

Clustering attempts
The clustering mechanism provided by Tomcat was also enabled. This is an
excerpt from the server.xml files from the two workers:

<Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"
                 channelSendOptions="8">
          <Manager className="org.apache.catalina.ha.session.DeltaManager"
                   expireSessionsOnShutdown="false"
                   notifyListenersOnReplication="true"/>
          <Channel
className="org.apache.catalina.tribes.group.GroupChannel">
            <Membership
className="org.apache.catalina.tribes.membership.McastService"
                        address="228.0.0.4"
                        port="45564"
                        frequency="500"
                        dropTime="3000"/>
            <Receiver
className="org.apache.catalina.tribes.transport.nio.NioReceiver"
                      address="auto"
                      port="4000"
                      autoBind="100"
                      selectorTimeout="5000"
                      maxThreads="6"/>
            <Sender
className="org.apache.catalina.tribes.transport.ReplicationTransmitter">
              <Transport
className="org.apache.catalina.tribes.transport.nio.PooledParallelSender"/>
            </Sender>
            <Interceptor
className="org.apache.catalina.tribes.group.interceptors.TcpFailureDetector"/>
            <Interceptor
className="org.apache.catalina.tribes.group.interceptors.MessageDispatch15Interceptor"/>
          </Channel>
          <Valve className="org.apache.catalina.ha.tcp.ReplicationValve"
                 filter=""/>
          <Valve
className="org.apache.catalina.ha.session.JvmRouteBinderValve"/>

          <Deployer
className="org.apache.catalina.ha.deploy.FarmWarDeployer"
                    tempDir="/tmp/war-temp/"
                    deployDir="/tmp/war-deploy/"
                    watchDir="/tmp/war-listen/"
                    watchEnabled="false"/>
          <ClusterListener
className="org.apache.catalina.ha.session.JvmRouteSessionIDBinderListener"/>
          <ClusterListener
className="org.apache.catalina.ha.session.ClusterSessionListener"/>
        </Cluster>

Regardless of the approaches used, session information from the client is
not being maintained.

I can verify that load balancing is working because requests from the client
application are being processed by one of the two workers. But since there
is no session information, the multiple requests needed for a single
publishing process fail to be directed to the correct server.

By explicitly passing a JSESSIONID in a format as expected by the current
configuration, I can forcefully direct the request to one of the workers:
http://localhost:8080/myservice/MyService?wsdl&JSESSIONID=nnnnnnnnnnnnnnnn.worker2
.

What could be the problem?

Mime
View raw message