8 Replies Latest reply on Apr 28, 2010 6:30 AM by Alexander Gorbachev

    Tuning the MaxThreadPool

    Chiu Tony Newbie

      My jboss server got several slow responses. I read from a passage that, it may due to the lack of Thread pool connection.
      However, that post suggested I can monitor the QueueSize in the JMX MBean first, if the QueueSize reaches the maximum thread pool size, I have to increase the maximum thread pool size.
      However, when I have a load test and monitor the QueueSize, the result is always 0. Is there any problem for reading the QueueSize?

        • 1. Re: Tuning the MaxThreadPool
          Chiu Tony Newbie

          The MBean is:

          jboss.system->ThreadPool->QueueSize

          • 2. Re: Tuning the MaxThreadPool
            Peter Johnson Master

            That is not a valid mbean name. Do you mean, perhaps, the jboss.system:service=ThreadPool mbean?

            If that queue size is always zero, then you have enough threads to handle the incoming requests. By the way, blindly adding more threads to the pool does not guarantee better performance. Adding more load (threads, in this case) to an overloaded system (too many threads contending for system resources) is a classic performance anti-pattern.

            I think in your other post (which I can't find right now - now you know why you shouldn't post the same question in multiple locations, it makes it difficult to have a single coherent conversation) I also asked if you had looked at garbage collection performance. Have you done that?

            • 3. Re: Tuning the MaxThreadPool
              James Sweeney Newbie

              Hi all,

              I am developing a JMX based tuning application. I am attempting to monitor the JBoss system threadpool queueSize but for every load I fire against the app server, the queuesize remains at 0.
              The JMX attribute is listed below.
              Domain: jboss.system Service:ThreadPool Attribute: QueueSize

              Can someone please verify that the queueSize can and does exceed zero?
              I have reduced the threadpool size in an attempt to back up requests onto the queue but the queueSize still remained at zero.

              I would appreciate any input on this.

              Thanks for your time,
              Best regards,
              James

              • 4. Re: Tuning the MaxThreadPool
                Jason Smith Newbie

                Hi James, wondering if you ever did get any helpful response to this question....I too have a similar question regarding this setting/control.

                 

                I don't understand why with 200 JBossWeb HTTP connector threads (mBean Domain=jboss.web; mBean Name=http-0.0.0.0-8180; mBean attribute maxThreads=200) hitting the system hard I never see the jboss.system queueSize go above zero (0)?

                • 5. Re: Tuning the MaxThreadPool
                  Peter Johnson Master

                  I cannot tell which mbean you are looking at, the name you gave is not complete. The mbean "jboss.web:name=http-127.0.0.1-8080;type=ThreadPool" (IP address and port number varies) keeps track of the number of active threads but does not track the current wait queue depth. There is no queueSize attribute. In fact, none of the MBeans that contain the property "name=http-127.0.0.1-8080" in their names have a queueSize attribute. I looked in both AS 3.2.4 and 5.1.0 (it would help if you stated the version of JBoss AS).

                  • 6. Re: Tuning the MaxThreadPool
                    Peter Johnson Master
                    One more thought - the thread pool monitored by the "jboss.system:service=ThreadPool" MBean comes into play only when using EJBs from remote clients. At least, I think that is the only situation under which that pool is used, there could be others. (There is even the possibility that I am thinking about another pool...) So no matter how busy the system gets servicing web requests, even if those requests in turn employ EJBs, this thread pool never gets used. And in addition, even if the pool gets used the QueueSize might not go above 0 until the threads in the pool are exhausted and requests start queuing up wafting for an available thread. But I am just guessing about that. I recall researching this a while back and had it clear in my mind then but it has been a while...
                    • 7. Re: Tuning the MaxThreadPool
                      Jason Smith Newbie

                      OK. Thanks. Peter.  You've answered what I think I was really trying to get clear in my head.  I thought that the two pools,

                       

                      1. the HTTP connector thread pool (governed by the MinThreads and MaxThreads parms on the connector in the server.xml in the ../default/jbossweb folder), and

                      2. the JBoss system thread pool (governed by the MaximumPoolSize attribute of the jboss.system:service=ThreadPool mbean definition defined in the jboss-service.xml file in the ../default/conf folder)

                       

                      were related.  Reason being, I came across the JBoss Tuning tips at:

                       

                      http://www.mastertheboss.com/en/jboss-application-server/113-jboss-performance-tuning-1.html

                       

                      and there was a comment relating to the HTTP conenctory thread settings that said:

                       

                      "if you increase the maxThreads count you need to raise your JBoss Thread pool accordingly".  I though that the thread pool being refered to here was the JBoss System Threads pool and in my mind this created a dependency between the two.

                       

                      I guess the other question I'm asking is:

                       

                      What are all the JBoss thread pools that come into play in order to support the needs of the variety of mainstream applications today (assuming its safe to frame the question this way!).

                       

                      The ones I've learnt about so far are:

                       

                      1.JBoss System Threads, attribute "MaximumPoolSize", defined in mBean name="jboss.system:service=ThreadPool" of $server_root/conf/jboss-service.xml

                      2.HTTP1.1 Connector Thread Pool, attribute "MaxThreads", defined in the <Server><Service><Connector> section of $server_root/deploy/jbossweb.sar/server.xml

                       

                      What other pools are there?  For each pool that comes to mind, what is the:

                       

                      thread pool name

                      defined how/where?

                      what type of processing/tasks it limits/controls ?

                      relationship with other pools?

                       

                      Any and all comments welcome.

                      • 8. Re: Tuning the MaxThreadPool
                        Alexander Gorbachev Newbie

                        Hi Peter Johnson  , Jason Smith and Chiu Tony

                         

                        I'm interested in the same question as Jason Smith mentioned above.

                        After I have read this article:

                        http://www.mastertheboss.com/en/jboss-application-server/113-jboss-performance-tuning-1.html

                         

                        What is the correlation between :

                        HTTP connector thread pool and   MaximumPoolSize ?

                         

                        Thank you in advance.