9 Replies Latest reply on Mar 18, 2008 6:58 PM by Peter Johnson

    query regarding the thread pool size in JBoss

    Puneet Jain Newbie

      Hi,

      I am using jboss-4.2.2.GA.
      I am trying to change the Thread pool size of JBoss in $JBOSS_HOME/server/default/conf/jboss-service.xml, under the
      But it is not getting reflected in the server.log.

      Am I changing the pool size at the correct location. If yes, then where should I check whether it has changed correctly or not?
      And what is its default pool size.


      Regards
      -Puneet

        • 1. Re: query regarding the thread pool size in JBoss
          Peter Johnson Master

          What did you set, maxThreads? minSpareThreads? maxSpareThreads? What did you set it to? If you view the connection in the JMX console, what are the values there?

          • 2. Re: query regarding the thread pool size in JBoss
            Puneet Jain Newbie

            Hi Peter,
            Thanks for the reply.

            I have set the max threads to 500. But dint do anything to minSpareThreads and maxSpare threads.
            And in the JMX console I could see the value that I have set. But its not there in the server logs..????

            Another problem is this...
            I have tested the performance MULE over JBoss using JMeter. I have taken the number of users as 1, 2, 10, 25, 50, 100 with loop count 2.
            And I have captured the results, once with 10 as thread pool size and another time with 500 pool size.

            Expected was that with 500 pool size, the response time should improve. But the results were very inconsistent.

            Following are the results:


            #users 1 10 25 50 100
            #Loops 2
            ThreadPoolSize 500
            ResponseTime(sec) 0.14 0.38 0.92 2.014 4.565


            And another one:

            #users 1 10 25 50 100
            #Loops 2
            ThreadPoolSize 10
            ResponseTime(sec) 0.109 0.411 0.957 1.989 4.855

            What is the expected behavior on increasing the thread pool size.?

            • 3. Re: query regarding the thread pool size in JBoss
              Peter Johnson Master

              What line(s) of the server log are you looking at? Possibly they reflect only the min threads.

              More is not always better. The more threads you allocate, the more contention there will be for the CPU(s).

              • 4. Re: query regarding the thread pool size in JBoss
                Puneet Jain Newbie

                Hi,

                I am using jboss-4.2.2.GA free/open source version.
                I have deployed a session bean on the JBoss application server. And testing the performance of the session bean using JMeter.

                First the thread pool size is set to 500 and tested for 1000 users. The response time is 24417ms.

                Next the thread pool size is increased to 1000 and tested againg. Expected was that the response time should be improved. But the response time is found to be 24298ms.

                I am unable to find the reason behind this kind of behavior of JBoss. Can anyone help me regarding the same.


                Regards
                -Puneet.

                • 5. Re: query regarding the thread pool size in JBoss
                  Peter Johnson Master

                  If you are using JMeter to directly test the EJB (that is, you are not going through a web page), then changing the thread pool size will have no effect. The thread pool is not used to allocate EJBs.

                  • 6. Re: query regarding the thread pool size in JBoss
                    Puneet Jain Newbie

                    Thanks for the reply.

                    I am creating Http request through JMeter from a different machine. And JBoss Application server is running on a different machine in same network.

                    Could you please ellaborate the difference in creating the Http request through JMeter and creating the Http Request through a Web Page to the EJB(Stateless Session Bean).


                    Regards
                    -Puneet

                    • 7. Re: query regarding the thread pool size in JBoss
                      Peter Johnson Master

                      It has been a while since I played with JMetere, but I recall that it has a mechanism to test EJBs directly, and not through a web page (ie, via http).

                      You are not, by any chance, using a web service to access the EJB? I assume you have JMeter accessing a servlet or JSP which in turn is accessing the EJB.

                      But my original assertion still holds:

                      More is not always better. The more threads you allocate, the more contention there will be for the CPU(s).


                      There is always a sweet spot when setting any pool size. Going either above or below it causes performance degradation. The key is finding the sweet spot, which usually involves repeatedly running the test using different pool sizes. Of course, you also have to determine if the pool size is what is causing the bottleneck - if the bottleneck is elsewhere in the system then no amount of pool size tweaking will help. If you don't know how to do this yourself, you will have to hire someone to do it.

                      • 8. Re: query regarding the thread pool size in JBoss
                        Puneet Jain Newbie

                        Appreciate your valuable inputs.

                        We are not using web services to EJB through JMeter.

                        We are wondering if thread pool size not affecting the performance could be becuase we are using jboss-4.2.2.GA free/open source version.

                        We are not using commercial version of JBoss for the development.

                        We seeing following errors in the log files when there running throug JMeter for 500 threads and 2 loops:

                        2008-03-19 01:59:07,926 DEBUG [org.jboss.mq.pm.jdbc2.PersistenceManager] Could not create table with SQL: CREATE CACHED TABLE JMS_MESSAGES ( MESSAGEID INTEGER NOT NULL, DESTINATION VARCHAR(255) NOT NULL, TXID INTEGER, TXOP CHAR(1), MESSAGEBLOB OBJECT, PRIMARY KEY (MESSAGEID, DESTINATION) )
                        java.sql.SQLException: Table already exists: JMS_MESSAGES in statement [CREATE CACHED TABLE JMS_MESSAGES]
                        at org.hsqldb.jdbc.Util.throwError(Unknown Source)
                        at org.hsqldb.jdbc.jdbcPreparedStatement.executeUpdate(Unknown Source)
                        at org.jboss.resource.adapter.jdbc.CachedPreparedStatement.executeUpdate(CachedPreparedStatement.java:95)
                        at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeUpdate(WrappedPreparedStatement.java:251)
                        at org.jboss.mq.pm.jdbc2.PersistenceManager.createSchema(PersistenceManager.java:273)
                        at org.jboss.mq.pm.jdbc2.PersistenceManager.startService(PersistenceManager.java:1789)
                        at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
                        at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
                        at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
                        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                        at java.lang.reflect.Method.invoke(Method.java:597)
                        at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
                        at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
                        at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
                        at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
                        at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
                        at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
                        at $Proxy0.start(Unknown Source)
                        at org.jboss.system.ServiceController.start(ServiceController.java:417)
                        at org.jboss.system.ServiceController.start(ServiceController.java:435)
                        at org.jboss.system.ServiceController.start(ServiceController.java:435)
                        at org.jboss.system.ServiceController.start(ServiceController.java:435)
                        at org.jboss.system.ServiceController.start(ServiceController.java:435)
                        at org.jboss.system.ServiceController.start(ServiceController.java:435)
                        at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)

                        Any help would be greatly appreciated.

                        • 9. Re: query regarding the thread pool size in JBoss
                          Peter Johnson Master

                          There is no performance difference between JBoss AS (community version) and JBoss EAP (enterprise version).

                          The error is expected. The messaging server checks to see if the database is initialized when it first comes up. If it isn't, you see these DEBUG statements (note that it is not an error) in the server log. The messaging server then creates the tables.