5 Replies Latest reply on Jul 3, 2014 8:53 AM by purplehaze007

    EJB pool size configuration in JBOSS 7.1.0 (Thunder)


      My EJB 2.1 application has about 35+ session beans (all stateless) & I need to set max pooled instances of EACH BEAN to 500.
      I referred to this post - Re: Setting max pool size in Jboss 7.1.0.Beta1 ; defined a common pool for each bean (i.e- each of the 35 bean's descriptor had the same bean-instance-pool-ref) and then set the pool size to 500 in standalone.xml:


      snippet of jboss-ejb3.xml file in each of the 35 beans:









      Entry in standalone.xml ejb3 subsystem:


           <strict-max-pool name="my-new-pool" max-pool-size="500" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/> 



      My query is - does above config in standalone mean each bean can have max 500 instances ? Or does it apply to overall number of instances in the pool regardless of bean-type?

      In case it applies to all beans regardless of bean-type; is it advisable to define pool-size by averaging it out ? (i.e - 35 * 500 = 17500) , OR - should i define a separate pool (i.e - 35 pools) for each bean and then define max-pool-size for each pool individually in standalone.xml file ? What is the recommended approach , performance benefit of either approach ?


      Any insight into the above is highly appreciated. Thanks in advance..

        • 1. Re: EJB pool size configuration in JBOSS 7.1.0 (Thunder)

          BUMP...  Anyone ?

          • 2. Re: EJB pool size configuration in JBOSS 7.1.0 (Thunder)

            Hello Rahul,


            welcome to the forums.

            As this is a community forum where all people are volunteers you can not expect an answer within such short time.



            To answer your question, the pool size is meant per bean type, so you will have a maximum of 500 instances for each EJB.

            The pool is filled legacy so if there is a bean with less parallel use there are less instances build and pooled.

            • 3. Re: EJB pool size configuration in JBOSS 7.1.0 (Thunder)

              Hi Wolf-Dieter Fink,


              Thank you for the  welcome and a gazillion tons for your response! I had been breaking my head over this since last 2 weeks - hence the urgency.
              Will certainly be a little more patient next time. Just a small follow-up query - for understanding purpose; is there any benefit/loss in performance if many pools are created with same max-limit ?

              • 4. Re: EJB pool size configuration in JBOSS 7.1.0 (Thunder)

                I'm not aware of as you need to have the same number of pooled instances in both cases.

                • 5. Re: EJB pool size configuration in JBOSS 7.1.0 (Thunder)

                  Ok...thank you.


                  For testing/verification; I tried the initial setting mentioned in my 1st post; set the max size to 15 and deployed my application. For verifying/monitoring i used the jvisualVM Mbeans and found something weirdly interesting...For bean in the application; it definitely says that poolMaxSize is 15 and poolCurrentSize is 3 or 4; (after few operations on application).


                  However - attribute poolAvailableCount is 106. (it is described as 'no. of avaiable(i.e not-in-use) instances in the pool'. This count keeps increasing significantly after any operation i carry out (which uses the bean). This is true for all beans - however the value is varying. How is this possible ? Is the attribute supposed to mean something else ? Have attached an image below.