Hi,
I asked me how I can test Loadbalancing (Round-Robin or are there other implementations) and Failover. I do have a simple stateless/JPA application deployed on two instances on one machine. I have several Java Clients doing some load on the application. I watch the two instances on CPU time and I can see that one is always taking the requests, the other is nearly idle. Is this the expected behaviour?
The next question is, can I debug one instance and the other instance is still taking the requests without interuption? I tried this but it does not work, both instances are stuck in debug even only one instance is in debug mode and the other is not.
Thanks for any clarification,
regards,
Igor
Hi Igor,
First of all, let me ask you what you mean by "instance"? Do you mean server nodes (e.g. server0, server1) or do you really mean instances (like JC00)? The behavior is different in these two cases.
Regarding Failover, there is a nice demo available in the NetWeaver Developer Studio. From the Welcome page navigate to Tutorials and then Sessions Failover. Probably you can use it as a reference for your test scenarios.
Best regards,
Vladimir
Hi Vladimir,
thanks for the answer. With instance I mean server0, server1 which result in 2 OS processes (2 JVMs). I had a look to the demo application and saw that it's a J2EE 1.4 one. Even it should not change nothing to the behaviour, I would like to use my application. It's pure stateless and just uses the maxDB. I only noticed that when I use my Java Client, in a seperate JVM (of course), all the requests are going to the same server0. server1 is nearly always idle. Maybe a WebApplication behaves different. I use P4 with my Java client.
What about debugging, I could not see in the demonstration that it's possible to debug one instance and the other instance continue to accept the requests, is this possible?
regards,
Igor
Hi Nikolai,
thanks for your answer. I try to dig more deep 😉
Actually I have a EJB3 complient client:
public class TestClient {
@EJB
private static AperoBiRemote remoteFacade;
public static void main(String[] args) throws Exception {
for (int _i = 0; _i < 400; _i++) {
List<Apero> _aperos = remoteFacade.getAllAperos();
}
}
}
I start two clients with this code in it on it's own jvm. Actually the @EJB should be replaced with InitialContext or like this at build time. When I run the two clients they both go only to one instance of the server processes. The other server process is idle? Why this? Even if I start 10 clients all are going only to one instance??
kind regards,
Igor
Hi Martin,
thanks for your clarifying eMail. I did some more tests and found out that with the web frontend using the ejb application there is a loadbalancing happening. But with the Java Client Application Front-end it's not happening? Any idea why? did you made tests using P4 and seeing the loadbalancing working? What is the difference to my Application client?
best regards,
Igor
Add a comment