my dog learned polymorphism*
The moose likes JBoss/WildFly and the fly likes Performance Concurrent Access Statelss Session Bean 2.1 JBoss 5.1 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "Performance Concurrent Access Statelss Session Bean 2.1 JBoss 5.1" Watch "Performance Concurrent Access Statelss Session Bean 2.1 JBoss 5.1" New topic
Author

Performance Concurrent Access Statelss Session Bean 2.1 JBoss 5.1

Aayush Singhal
Ranch Hand

Joined: Jan 06, 2011
Posts: 47
Hi all,

I have a fairly simple problem.

I have a third-party developed EJB application deployed on JBoss 5.1 server. I am trying to load test the application by accessing a single EJB from multiple threads from my local client.


below is the output :

logged in 1395842350839
object looked up 1395842353718
Company/ECA/ConfigHome 1395842353720
created the session1395842355107
thread number : 1 : calling the EjbMethod at 1395842355109
thread number : 2 : calling the EjbMethod at 1395842355109
thread number : 3 : calling the EjbMethod at 1395842355109
thread number : 6 : calling the EjbMethod at 1395842355110
thread number : 5 : calling the EjbMethod at 1395842355110
thread number : 7 : calling the EjbMethod at 1395842355111
thread number : 9 : calling the EjbMethod at 1395842355111
All threads started at : 1395842355111
thread number : 10 : calling the EjbMethod at 1395842355111
thread number : 4 : calling the EjbMethod at 1395842355113
thread number : 8 : calling the EjbMethod at 1395842355113
thread number : 1 : called the EjbMethod at 1395842355499
thread number : 2 : called the EjbMethod at 1395842356255
thread number : 5 : called the EjbMethod at 1395842356264
thread number : 6 : called the EjbMethod at 1395842356274
thread number : 7 : called the EjbMethod at 1395842357268
thread number : 4 : called the EjbMethod at 1395842357277
thread number : 10 : called the EjbMethod at 1395842357287
thread number : 8 : called the EjbMethod at 1395842357297
thread number : 9 : called the EjbMethod at 1395842357307
thread number : 3 : called the EjbMethod at 1395842357318
All threads finished at : 1395842357318


Below are the output times when I sequentially invoked the EJB 10 times (directly invoking 'currencydata = session.queryAllCurrencyData_6(null);' 10 times in main(). No parallel threads involved. Also only a single JNDI lookup and a single call to EjbCreate() as I used the same remoteObject for each invocation):

logged in 1395842765210
object looked up 1395842767187
Company/ECA/ConfigHome 1395842767188
created the session1395842768205
got response at : 1395842768546
got response at : 1395842768871
got response at : 1395842769192
got response at : 1395842769512
got response at : 1395842769834
got response at : 1395842770158
got response at : 1395842770479
got response at : 1395842770802
got response at : 1395842771125
got response at : 1395842771449



So as I observe the two, in sequential calls to the EJB, the response time is around 320ms every time.
So theoritically, If we invoked the same EJB 10 times in 10 parallel threads, it should take 320ms to finish all the threads, or maybe 500ms at the max.
But it is taking 1395842357318-1395842355111 = 2207ms = 2.2 seconds.

The AIX server on which the EJBs are deployed has 16 CPU cores available, 14 GB RAM.
I have checked the standardjboss.xml to have :
<container-pool-conf>
<MinimumSize>25</MinimumSize> <!-- I added this which improved the performance to this level-->
<MaximumSize>100</MaximumSize>
</container-pool-conf>
for Stateless Session Bean

What am I missing here? Any insights would be great.

Thanks.
Aayush





Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 9912
    
158

What exactly is the bean doing? More specifically what is the implementation of:



[My Blog] [JavaRanch Journal]
Aayush Singhal
Ranch Hand

Joined: Jan 06, 2011
Posts: 47
Thanks for the reply Jaikiran.
The bean is retrieving all the data from a database table.
The bean is developed by a third party team and we do not have the source-code for it.

Aayush
Aayush Singhal
Ranch Hand

Joined: Jan 06, 2011
Posts: 47
Could it be that the bean's code is taking some lock on some object before reading the table? but I don't think that they'll need to synchronize for reading a table? synchronizing for writing to a table makes more sense I guess.....
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 9912
    
158

The client code is timing the time taken for the bean call and unless you known what the bean implementation code looks like it will only be a guess as to what's causing the unexpected delay.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Performance Concurrent Access Statelss Session Bean 2.1 JBoss 5.1
 
Similar Threads
Stateful Session Beans..Help needed.
Message lost or are not pulled by MDB
invoking EBJ and updating database in a single transaction
Performance wrt multi threaded approach with Thread Pool vs Sequential execution
Review : MultiThreading Solution Implementation