Performance problem with EJB

Discussions

Performance and scalability: Performance problem with EJB

  1. Performance problem with EJB (11 messages)

    I am working on a entriprise application using following architechture-

     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 cleint 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).

     Any help will be well appreciated.

     Thanks.

    Threaded Messages (11)

  2. Performance problem with EJB[ Go to top ]

    What do you do during the create calls? Do you create several Entity Beans, etc?

    I think you should look at the create logic and the cascading "creates" that could be triggered by an innocent "create" call on your SLSB.

    Or you could post more details as to what you do during the SLSB method call the first time around?
    --Das
  3. Performance problem with EJB[ Go to top ]

    Thanks Das.

    4. The ejbCreate method do 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.
    My guess is, it may be the similar case when client calls create method for SLSB.

    Any help?
  4. Performance problem with EJB[ Go to top ]

    I think I should clarify my question. What I meant to ask was "When you call your first method, what happens on the EJB tier?".
    It seems as if there is some initialization being done by your first method call which is not done in subsequent calls. There must be a bottleneck somewhere - maybe limited connection pools, or some such thing.

    --Das
  5. Performance problem with EJB[ Go to top ]

    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.

    As I said earlier, resource analyzer gave method execution time as 0.39 sec for first time method called and ~0.2 sec for subsequent calls.

    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? And how to locate it?

    I have follwoing understanding of how a remote method is called (correct me if I am wrong). Broadly-
    Client (1) -> remote method call (2) -> orb layer (3) -> container implemetation (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 begining of session bean life cycle?

    Another interesting fact is that this kind of delay does not happen when one session bean create another session bean and execute its methods.
  6. Performance problem with EJB[ Go to top ]

    Use Weblogic instead of Websphere... you won't encounter these problems. Anyways, if you're stuck with Websphere due to corporate politics, good luck.
  7. Performance problem with EJB[ Go to top ]

    I think Marco meant to mention that he works for Weblogic.

    Tom
  8. Performance problem with EJB[ Go to top ]

    Please disregard my last post. I am just disgusted by some corporate politics here in our office that seems to favor Websphere without even listening to our technical comparison between the two. It seems that these people have made up their mind and even though they know, and take note, accept, that Weblogic is more technically superior than Websphere, they just don't care.
  9. Performance problem with EJB[ Go to top ]

    I would say dump both - Weblogic and Websphere and go for JBOSS with it's superb architecture and zero licensing cost.

    Pranab
  10. Performance problem with EJB[ Go to top ]

    These response do noone any good. I happen to work for a company that chose Websphere as a standard (in addition to Weblogic). We had our reasons but they weren't political (mostly it was cost per transaction) But that is not the point. Advertisements for peoples favorite servers (or their own) have no place here.
    BTW, In my our performance tests, Weblogic finished third. For cost per transaction it was at the bottom of the pack.
  11. Performance problem with EJB[ Go to top ]

    exactly, we did our performance tests when picking up app servers, but unfortunately for weblogic fans, it finished third on the list. websphere 4.0 won the battle.
  12. Performance problem with EJB[ Go to top ]

    You may have already figured this out given that this thread is about a month old now, but getting the initial context and looking up the bean can take a significant amount of time the first time versus the second time when the initial context and home interface are cached. Starting up the orb process the first time for the lookup takes a small amount of time too. You could consider moving this to a startup section of your application so the first user doesn't see it. You can write a java client that times how long each of these basic ejb steps take to investigate this further, and there are also flexible tools available for doing this investigation like Bean-test.

    I wasn't sure from your call chain steps 1-8 where the home interface is gotten and whether it is done every time.