-
1. Re: Clustering (failover) works but not RoundRobin load-bala
slaboure Apr 10, 2002 4:41 AM (in response to arenam)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 Apr 10, 2002 2:59 PM (in response to 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 Apr 11, 2002 8:11 AM (in response to arenam)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