File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB and other Java EE Technologies and the fly likes Performance Problem with EJB--Need expert guidence Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of JavaScript Promises Essentials this week in the JavaScript forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Performance Problem with EJB--Need expert guidence" Watch "Performance Problem with EJB--Need expert guidence" New topic
Author

Performance Problem with EJB--Need expert guidence

Venkataramu Pendiyala
Greenhorn

Joined: May 16, 2001
Posts: 25
I am working on an enterprise application using following architecture-
Java Thin Client -> Session Beans (Stateless) -> Entity Beans -> Oracle 8.1.7
I am using VAJ 3.5 for application development with WebSphere application server 3.5.
I am facing following problem-
1.It takes about 65 seconds to return a create call for Session bean from client application.
2.A method call on this newly created session bean takes about 60-65 seconds to return.
3.Then onwards, any other method call to the same session bean takes only a fraction of a second to execute.
Now my question is why does it take so long to return a create call? And why does it take so long to return method call for the very first time?
How can this time be reduced?
WebSpere is running on HP-Ux with good amount of memory available to it (~500MB/processor).
4.The ejbCreate method does not have any implementation for it. So there is no chance of any cascade creates that might trigger in it.
5.I downloaded the Resource Analyzer from IBM site for WAS3.5. I am studying it to see how far can I use it to track down this performance problem.
My initial analysis shows that it takes only 390 msecs to execute the first time method is called (point 2 in my previous post).
Whereas Client Application waits for 60-65 seconds before method call returns.
So now my question is where is this time going in?
Why it takes that long for WAS to find the bean and execute the method call?
6.The subsequent calls to the same method takes even less time (point 3 in my earlier posting). Avg. 261 msecs for 2 method calls. This time client receives the returns immediately. (Just to clarify - it does not matter if I call the same method or a different method for SLSB, method returns immediately.)
I am not able to understand why would it take almost 60-65 seconds to call a method on newly created session bean.
Whereas it takes no time for subsequent method calls to complete.
My guess is it may be the similar case when client calls create method for SLSB.
Every method call does very much the same thing.
a.Lookup Entity Bean, call finders, collect/update data and return.
b.Sometimes create another session bean and call its methods, that in-tern perform step a.
I also checked (using resource analyzer) -
orb thread pool - is never maxed out.
Database connection pool - 0 wait time.
I know there is some bottleneck, but where? How to locate it?
I have following understanding of how a remote method is called. Broadly-
Client (1) -> remote method call (2) -> orb layer (3) -> container implementation (4) -> method execution (server) (5) -> return value (6) -> orb layer (7) -> return value to client (8)
Between step (1) to (8) it takes ~65 seconds - for "first time method call" (and for "create" also).
Step (5) takes only 0.39 secs for "first time call".
So where rest of the time is going?
What is happening at step (2), (3) and (4) and how to analyze it?
And why it happens only in the beginning of session bean life cycle?
Another interesting fact is that, this kind of delay does not happen when one session bean creates another session bean and executes its methods.

SCJP
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Performance Problem with EJB--Need expert guidence