-
1. Re: Jboss server fails with 20 concurrent hits - service una
slaboure May 6, 2004 10:48 AM (in response to rraam75)you simply need to augment the backlog of the JNP service so it can queue enough requests.
sacha -
2. Re: Jboss server fails with 20 concurrent hits - service una
rraam75 May 7, 2004 4:41 AM (in response to rraam75)hi,
thanx Sacha
I changed the backlog value from 50 to 500 & 5000..but still i face the same exception...
In the above mail in the run() mtd i wrongly given the code that belongs to weblogic server...however there is not much change except the setting of env properties...
Below is the correct version of code at run() mtd..
public int callJBossHome() {
try {
Properties env = new Properties();
InitialContext initialContext = null;
env.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
env.put(Context.PROVIDER_URL, "jnp://127.0.0.1:1099");
env.put(Context.BATCHSIZE,"1000");
initialContext = new InitialContext(env);
try {
clusterEmpSLSessionHome = (ClusterEmpSLSessionHome) javax.rmi.PortableRemoteObject.narrow( initialContext.lookup("ClusterEmpSLSessionBean"),
ClusterEmpSLSessionHome.class);
}catch (Exception e1){
System.out.println("Exception at LOOKUP is"); e1.printStackTrace();
}
ClusterEmpSLSession clusterEmpSLSession = clusterEmpSLSessionHome.create();
return 0;
} catch (Exception e) {
System.out.println("Exception while creating remote obj is:");
e.printStackTrace();
return -1;
}
}
do u have any other options to solve this problem...I tried to do the same thing with weblogic server..there i can make 5000 concurreny hits or lookups...
In addition to that can anyone explain me about the env properties,
env.put(Context.BATCHSIZE,"1000");
thanx -
3. Re: Jboss server fails with 20 concurrent hits - service una
rajsgarage May 10, 2004 9:32 AM (in response to rraam75)I carried out the test as rram75 had suggested and ended up getting timed out exception with jboss.
I also tried hitting weblogic server with the same code and it did work perfectly fine. One thing i did try was to print the thread name to see, whether in case the call to the server was synchronized and i was right. Web logic did synchronize the calls to the naming server.
I debugged the jboss naming client code and modified the static Naming getServer(String host, int port, Hashtable serverEnv) throws NamingException code to be synchronized and that took care of the socket timeout exception that was happening before. THe reason for the socket exception was that at times, the Naming reference was null and it then tried to do a multicasting to find the server. This was the place where a socket time out happened.
I did a few testing and benchmarking with weblogic against jboss and found that jboss was faster with smaller amounts of hits to the server. ie, if i had 100 threads that hits the server using jndi , jboss would always beat weblogic in retrieving the objects. But for higher threshold values, weblogic beats jboss. This is probably due to the way it attempts reconnection in lookup function of org.jnp.Interfaces.NamingContext .java file. Augmenting the backlog also didnt help jboss in significantly reducing the time in retrieving objects using Jndi.
I am wondering if i had to do any thing else to make the jndi lookup faster?.
Regards,
Rajaneesh, Technologist
Vistasoft India -
4. Re: Jboss server fails with 20 concurrent hits - service una
satunattar May 27, 2004 5:54 AM (in response to rraam75)Hi,
Take a look at
http://java.sun.com/products/jndi/tutorial/ldap/search/batch.html
for - Context.BATCHSIZE property