LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

Persistence question with threads

To: lvs-users@xxxxxxxxxxxxxxxxxxxxxx
Subject: Persistence question with threads
From: "Mr. CBoy" <cboy168@xxxxxxxxx>
Date: Fri, 10 Mar 2006 01:19:34 -0800
Currently I am using LVS-Nat with 2 real JBoss servers.

In my test environment I have 1 client that spawns hundreds of threads that
will invoke methods through RMI.

The flow is like this:

Client sends a request to the VIP for a naming proxy which will get
forwarded to RS1.
RS1 will then push down the naming proxy back to the client, but will be
masquerated by the director.
The client will ask for the stub on the remote object so that it can invoke
methods and it will be returned.

Now the client has the stub and can start to invoke methods, but here lies
the problem.
The stub came from RS1 and when the client calls a method on the stub, it
gets load balanced to RS2 and becomes invalid.

In a real world example, turning on persistance would remedy this however in
a test environment, I'm limited by hardware.

Is there anyway to get threads on the same client to talk to the same real
server?

The client code is something simple like

MyObject obj = (MyObject) Naming.lookup("rmi://VIP/obj");
obj.callSomeMethod();

All the underlying connection details are handled by Sun's RMI so I'm unable
to keep 1 connection for each thread myself, so my only guess is to figure
out a way for LVS to handle it.

I'm open to any ideas/comments/suggestions.

Thanks.

<Prev in Thread] Current Thread [Next in Thread>