5 Replies Latest reply on Feb 15, 2007 10:51 AM by aleksab

    Sizing a Stateless Session Bean Pool Size

      I feel like I am asking a stupid question, but where do you configure your Stateless Session Bean Pool Size. I would assume that you can create a pool for each different SLSB you have, so one could have min/max say 20/50 and have a different SLSB be min/max 100/200

      Thanks

        • 1. Re: Sizing a Stateless Session Bean Pool Size
          klejs

          Look for these entries in your standardjboss.xml:

          <instance-pool>org.jboss.ejb.plugins.StatelessSessionInstancePool</instance-pool>
          ...
          <container-pool-conf>
           <MaximumSize>100</MaximumSize>
          </container-pool-conf>


          /klejs

          • 2. Re: Sizing a Stateless Session Bean Pool Size
            bill.burke

            This person is incorrect...

            By default, SLSBs use a ThreadLocal pool. So, one instance is created per thread. TheadLocal pools allow you to avoid synchronization.

            So basically, you have, by default as many SLSB instances as your greatest volume of concurrent requests.

            Download RC9 release and read the documentation on how to change things. For instance, there is a StrictPool setting that will set a max and block requests if that max is met.

            • 3. Re: Sizing a Stateless Session Bean Pool Size
              varunnarang

              Hello,
              Here I've some problem quite aligned to the subject.
              Actually I want to restrict max no of StatefulSessionBean instances in the EJB3.0 configuration. My main objective is to make methods postActivate() (decorated with anno. @PostActivate) and prePassivate (with @PrePassivate) get called, for a test environment.

              Please help me with the configuration of EJB3.0.
              Thanks & Regards,
              Varun Narang.

              • 4. Re: Sizing a Stateless Session Bean Pool Size
                amedina

                You can also set that in the standardjboss.xml file. Just scroll down, till you find that:

                <container-configurations>
                 <container-configuration>
                 <container-name>Standard Stateful SessionBean</container-name>
                 ...
                 <overager-period>300</overager-period>
                 <max-bean-age>600</max-bean-age>
                ...
                


                max-bean-age is the time in seconds, a stateful bean has to be idle before it gets passivated.
                the overager-period is the time period, the beans get checked for passivation.

                Alternatively, you can copy the whole container configuration to a jboss.xml file which has to be located in the META-INF-Directory of your Bean .jar.

                • 5. Re: Sizing a Stateless Session Bean Pool Size
                  aleksab

                  If the pool size for a bean is set to 1, would the second request be blocked or will it simply use the same instance??

                  I'm trying to share state between stateless beans, and therefore want to set the pool size to 1. However, not if the second/third request is blocked.