T
Tassilo Kubitz
We are using J2RE 1.4.1 IBM AIX build ca141-20030703a (JIT enabled)
on our AIX 5.2.
I wrote a simple RMI-Server that starts up and listening for remote
requests as well as an client, that will access this server.
All platforms (win32, Linux, zLinux, Solaris 2.7, HP-UX 11.10)
performing well.
Only AIX 5.2 has a performance problem during the methods
LocateRegistry.createRegistry(),
Naming.rebind() and Naming.lookup().
All other platforms takes only 20-35 ms for these methods.
AIX needs between 75-90 sec !!!.
I test all of my code locally (localhost - 127.0.0.1), but I found no
explanation. IBM has reproduced this problem, but has no answer.
Do you have any idea?
Example Code below
TestService.java:
-----------------
import java.rmi.Remote;
import java.rmi.RemoteException;
public interface TestService extends Remote
{
public String getTest()
throws RemoteException;
}
TestServer.java:
----------------
import java.rmi.Naming;
import java.rmi.RemoteException;
import java.rmi.registry.LocateRegistry;
import java.rmi.server.UnicastRemoteObject;
public class TestServer extends UnicastRemoteObject implements
TestService
{
public TestServer() throws RemoteException {
super();
}
public String getTest() {
return "foo.bar";
}
public static void main(String[] args) {
long time,start;
try {
//TestServer testServer = new TestServer();
start = System.currentTimeMillis();
time = start;
System.out.println("before create: "+time);
LocateRegistry.createRegistry(4711);
time = System.currentTimeMillis() - start;
System.out.println("after create: "+time);
start = System.currentTimeMillis();
TestServer testServer = new TestServer();
time = System.currentTimeMillis() - start;
System.out.println("after new: "+time);
start = System.currentTimeMillis();
Naming.rebind("//127.0.0.1:4711/TestServer", testServer);
time = System.currentTimeMillis() - start;
System.out.println("after rebind: "+time);
} catch (Exception e) {
e.printStackTrace();
}
}
}
TestClient.java:
----------------
import java.rmi.Naming;
public class TestClient
{
public TestClient() {
}
public static void main(String args[]) {
TestClient testClient = new TestClient();
testClient.run();
}
static TestService testStub;
void run() {
long time, start;
try {
start = System.currentTimeMillis();
time = start;
System.out.println("before lookup: "+time);
testStub = (TestService)Naming.lookup("//127.0.0.1:4711/TestServer");
time = System.currentTimeMillis() - start;
System.out.println("after lookup: "+time);
start = System.currentTimeMillis();
System.out.println(testStub.getTest());
time = System.currentTimeMillis() -start;
System.out.println("end: "+time);
} catch (Exception e) {
e.printStackTrace();
}
testStub = null;
}
}
Note: JIT is not the problem
Many thanks
Tassilo
on our AIX 5.2.
I wrote a simple RMI-Server that starts up and listening for remote
requests as well as an client, that will access this server.
All platforms (win32, Linux, zLinux, Solaris 2.7, HP-UX 11.10)
performing well.
Only AIX 5.2 has a performance problem during the methods
LocateRegistry.createRegistry(),
Naming.rebind() and Naming.lookup().
All other platforms takes only 20-35 ms for these methods.
AIX needs between 75-90 sec !!!.
I test all of my code locally (localhost - 127.0.0.1), but I found no
explanation. IBM has reproduced this problem, but has no answer.
Do you have any idea?
Example Code below
TestService.java:
-----------------
import java.rmi.Remote;
import java.rmi.RemoteException;
public interface TestService extends Remote
{
public String getTest()
throws RemoteException;
}
TestServer.java:
----------------
import java.rmi.Naming;
import java.rmi.RemoteException;
import java.rmi.registry.LocateRegistry;
import java.rmi.server.UnicastRemoteObject;
public class TestServer extends UnicastRemoteObject implements
TestService
{
public TestServer() throws RemoteException {
super();
}
public String getTest() {
return "foo.bar";
}
public static void main(String[] args) {
long time,start;
try {
//TestServer testServer = new TestServer();
start = System.currentTimeMillis();
time = start;
System.out.println("before create: "+time);
LocateRegistry.createRegistry(4711);
time = System.currentTimeMillis() - start;
System.out.println("after create: "+time);
start = System.currentTimeMillis();
TestServer testServer = new TestServer();
time = System.currentTimeMillis() - start;
System.out.println("after new: "+time);
start = System.currentTimeMillis();
Naming.rebind("//127.0.0.1:4711/TestServer", testServer);
time = System.currentTimeMillis() - start;
System.out.println("after rebind: "+time);
} catch (Exception e) {
e.printStackTrace();
}
}
}
TestClient.java:
----------------
import java.rmi.Naming;
public class TestClient
{
public TestClient() {
}
public static void main(String args[]) {
TestClient testClient = new TestClient();
testClient.run();
}
static TestService testStub;
void run() {
long time, start;
try {
start = System.currentTimeMillis();
time = start;
System.out.println("before lookup: "+time);
testStub = (TestService)Naming.lookup("//127.0.0.1:4711/TestServer");
time = System.currentTimeMillis() - start;
System.out.println("after lookup: "+time);
start = System.currentTimeMillis();
System.out.println(testStub.getTest());
time = System.currentTimeMillis() -start;
System.out.println("end: "+time);
} catch (Exception e) {
e.printStackTrace();
}
testStub = null;
}
}
Note: JIT is not the problem
Many thanks
Tassilo