3 Replies Latest reply on Apr 11, 2002 8:11 AM by slaboure

    Clustering (failover) works but not RoundRobin load-balancin

    arenam

      I have read the other forum threads related to RoundRobin load-balancing and they did not solve the problem where the EJB request is always sent to the last node to join the cluster.
      I have clustering running (using the default cluster-service.xml provided) and I confirmed that failover does work.
      But load-balancing does not.
      I have a SLSB with the True tag in the jboss.xml descriptor (but I did not add a cluster-config tag since the default policy is RoundRobin).
      I put the same MyBean.jar in the deploy directory of both servers (one on Win2K and one on Solaris 8).
      For the JNDI lookup, it does not seem to matter which node of the cluster or which port I use (jnp or HA):
      jnp://localhost:1099 -> calls bean on remote node of cluster
      localhost:1100 -> calls bean on remote node of cluster
      localhost:1100,otherhost:1100 -> calls bean on remote node of cluster

      These are the only messages I get when deploying the bean:
      12:52:58,005 INFO [MainDeployer] Deploying: file:/usr/users/cluster/jboss-3.0.0beta/deploy/MyBean.jar
      12:52:58,463 INFO [EJBDeployer] Deploying com.lightbridge.xyz.ejb.MyBean

      BTW, what is the deploy/farm directory for?

        • 1. Re: Clustering (failover) works but not RoundRobin load-bala
          slaboure

          Hello,

          For the load-balancing issue, please try the latest CVS version. I made some modifications and tested it on monday: everything is fine with latest CVS.

          Thank you. Cheers,


          Sacha


          p.s.: deploy/farm, if the farm service is deployed, allows you to automatically deploy a jar/sar/... in the whole clustering by simply dropping the file in this folder

          • 2. Re: Clustering (failover) works but not RoundRobin load-bala
            arenam

            The latest Beta build from Sacha seems to work.
            However, I have noticed that the client side's behavior also has an effect on whether load-balancing works properly.
            If I have a client that calls an SLSB in a loop and in each iteration of the loop I look up the Home interface of the bean, then I will always go to the first node in the cluster:

            InitialContext ctx = new InitialContext(ht);
            for (int i=0 ; i<5 ; i++)
            {
            Object helloHomeObj = ctx.lookup("lightbridge.Hello");
            HelloHome helloHome = (HelloHome)
            javax.rmi.PortableRemoteObject.narrow(helloHomeObj,HelloHome.class);
            Hello hello = helloHome.create();
            ...
            }

            However, If I only lookup the Home interface once (outside the loop), then I observe the correct load-balancing behavior:

            InitialContext ctx = new InitialContext(ht);
            Object helloHomeObj = ctx.lookup("lightbridge.Hello");
            HelloHome helloHome = (HelloHome)
            javax.rmi.PortableRemoteObject.narrow(helloHomeObj,HelloHome.class);
            for (int i=0 ; i<5 ; i++)
            {
            Hello hello = helloHome.create();
            ...
            }

            Thanks for your help and quick responses, Sacha.

            • 3. Re: Clustering (failover) works but not RoundRobin load-bala
              slaboure

              This is logical: each proxy has its own set of target nodes. Consequently, if you get a new remote stub each time in your loop, you get a brand new set of target nodes! But getting a new remote each time is a huge waste of performance anyway (think round trip on the network)

              Cheers,


              sacha