users@glassfish.java.net

Re: Question about EJB concurrent behaviour

From: Dies Koper <dies_at_jp.fujitsu.com>
Date: Fri, 19 Oct 2007 17:45:58 +0900

Configurations> server-config> HTTP Service > RequestProcessing

Thread Count
    Maximum number of request processing threads

Drinkwater, GJ (Glen) wrote:
> Hi
>
> Yes, I am using a java program using threads to create the concurrent
> requests.
>
> Ok I have done some more testing
>
> This is the method I am calling, I am using a synchronized bean that
> holds the number of concurrent accesses to this method, which prints out
> concurrent accesses and waits 10 seconds.
>
> private static SynchronizedBean concurrent = new SynchronizedBean();
>
> @WebMethod
> public void tenSeconds() {
> try {
> concurrent.add();
>
> System.out.println("CONCURRENT
> "+concurrent.getCONCURRENT());
>
> Thread.sleep(10000);
>
> } catch (InterruptedException ex) {
> System.out.println(ex);
> } finally {
> concurrent.minus();
> }
> }
>
>
> When I run some client java program to create say, 30 requests, I get
> these results.
>
> Via EJB Remote Calls: 11s (# concurrent 30)
> Via Web Service Calls: 60 s (# concurrent 5)
>
> 40 requests
>
> Via EJB Remote Calls: 15s (# concurrent 40)
> Via Web Service Calls: 80 s (# concurrent 5)
>
> Basically, the ejb calls can run the method concurrently and works as
> you would expect, creating the correct amount of beans in the pool.
> But the Web Service call only ever hits 5 concurrent (I know I said 10
> in my last email, but I was using my laptop for my last tests and that's
> dual core, if that makes any difference). So basically the web service
> call handles the requests sequentially in 5s.
>
> Why is this, can I configure glassfish to improve this performance?
>
> Glen