users@glassfish.java.net

Question about EJB concurrent behaviour

From: Drinkwater, GJ \(Glen\) <"Drinkwater,>
Date: Thu, 18 Oct 2007 20:45:39 +0100

Hi

I am running into some concurrency problems with my application and I
have therefore done some testing.

I have devised a simple test.

 @WebMethod
    public void tenSeconds(){
          try {
                Thread.sleep(10000);
        } catch (InterruptedException ex) {
            
        }
    }

It's a stateless session beans that takes 10s to execute and I call this
via web services concurrently. I am using glassfish v2.

If I run 10 concurrent tests against this web services from a client via
web services, it takes 10 seconds to finish. The application server
creates 10 bean instances (monitoring the app server through the admin
console). Then if I increase it to 20 concurrent, the test takes 20 s,
30 concurrent, 30s, 50 concurrent 50s etc etc. The max bean instance
pool never gets above 10, even though the maximum pool size is set to
32. It seems the server is processing the requests in batches of 10,
and not increasing the pool size to the maximum of 32.

Why is this, I thought that the app server would increase the pool size
to the maximum before making other requests wait.

Can someone explain this behaviour to me?

Thanks Glen