[Design of EJB 3.0] - Re: Passivating EJB 3 Stateful Session Beans stops the World
by bstansberry@jboss.com
Just an update.
First, I deployed a bean with configuration like what you reported Andy, and when StatefulTreeCache was accessing the bean metadata to determine how to set up JBoss Cache's passivation, it got a maxSize=100000. So, that's all working fine.
I deployed the bean along with a little service that creates a configurable # of threads that loop a configurable number of times instantiating new beans. Doesn't use the beans after looking up the proxy and invoking a single getter. Fired it off telling it to use 4 threads to create 200K beans. Am now watching the JMX console view of the bean container to see what happens.
1) The CurrentSize attribute steadily rose past 10K; no apparent limit; eventually got up to over 24K
2) After 5 mins, consistent with the default @CacheConfig.idleTimeoutSeconds=300 in ejb3-interceptors-aop.xml, passivation kicked in and the CurrentSize started dropping a bit while PassivatedCount steadily rose. It would appear the single background thread is able to passivate beans faster than the 4 threads create them.
Judging from some periodic logging I added, it's taking about 6 secs to create 500 beans. The beans aren't particularly heavyweight, the client is in-vm, and there's only one node in the cluster, so no replication going on. So not particularly fast.
But, the passivation part seems to be working as I'd expect.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4184606#4184606
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4184606
15 years, 12 months
[Design of EJB 3.0] - Re: Passivating EJB 3 Stateful Session Beans stops the World
by andy.miller@jboss.com
"andy.miller(a)jboss.com" wrote : "andy.miller(a)jboss.com" wrote : "ALRubinger" wrote : "andy.miller(a)jboss.com" wrote : 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.
| | |
| | | In the end we're going to need a more isolated case that may involve invocations on an SFSB alone, or preferably something to test Cache passivation directly. Then we may apply the same test to any of our cache implementations.
| | |
| | | S,
| | | ALR
| | |
| | |
| |
| | I will work on cutting out just the code for the Stateful Session Bean, so it can be turned into an isolated test case tomorrow.
|
| I have been struggling to create a more isolated test case that's easy to run. I have a test case that is creating lots of Stateful Session Beans, but I can't get them to be cached (other than one bean at a time). What causes the bean to be cached, and then eventually passivated?
Okay, never mind. I had a little bug in the stateful session bean, and JBDS was not updating the ear dynamically (as it should have).
I now have an isolated test case that caches the stateful session beans. I will attach the code, and I profile of it soon.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4184569#4184569
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4184569
15 years, 12 months
[Design of EJB 3.0] - Re: Passivating EJB 3 Stateful Session Beans stops the World
by andy.miller@jboss.com
"andy.miller(a)jboss.com" wrote : "ALRubinger" wrote : "andy.miller(a)jboss.com" wrote : 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.
| |
| | In the end we're going to need a more isolated case that may involve invocations on an SFSB alone, or preferably something to test Cache passivation directly. Then we may apply the same test to any of our cache implementations.
| |
| | S,
| | ALR
| |
| |
|
| I will work on cutting out just the code for the Stateful Session Bean, so it can be turned into an isolated test case tomorrow.
I have been struggling to create a more isolated test case that's easy to run. I have a test case that is creating lots of Stateful Session Beans, but I can't get them to be cached (other than one bean at a time). What causes the bean to be cached, and then eventually passivated?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4184563#4184563
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4184563
15 years, 12 months