1 2 3 4 Previous Next 55 Replies Latest reply on Sep 3, 2012 11:05 AM by Fidel Andrés Vargas Londoño

    Passivating EJB 3 Stateful Session Beans stops the World!

    Andrig Miller Apprentice

      Carlo and Andrew,

      I have been running the same load test that I ran for my EAP 4.x performance tuning presentation (uses the EJB 3 Stress Test application we use in QE), and I have discovered what appears to be a pretty major problem. When I first kick-off a run, everything is running quite smoothly and I am actually getting slightly higher results than with EAP 4.2. Then everything just stops. The test just seems to be hung for anywhere between 30 seconds and a minute. Then everything starts again, and it runs like it was running before. In trying to correlate what was happening I found something quite interesting.

      In looking at the JMX console for my stateful session bean, I can see that when everything stops, is when the container is passivating bean instances. In fact, when everything stops, that is the only time that the passivation counts increments in the JMX console. On EAP 4.2/4.3 I noticed similar behavior, but never correlated it to anything, because it would stop only for 5 to 10 seconds, never this extended period of time. Even with these hangs, we are only about 8% slower than before, and if these hangs were eliminated, we would be faster by about 3%. Of course, I am using OpenJDK 6, versus using the Sun JDK 5, and the improvement may be just because of the JVM, but even if that is the case, we are probably a wash in terms of performance.

      In any case, this is a serious issue that needs investigation. Here is some more relevant information:

      The default cache configuration is being used, which should be the StatefulTreeCache, since I have the @Clustered annotation on my stateful bean.

      I can probably reduce the code down to just the servlet and stateful session bean, and strip out the database access, and just put a sleep in the method implementation.

        1 2 3 4 Previous Next