4 Replies Latest reply on Sep 30, 2005 3:16 PM by rcostanzo

    Too many threads being marked as busy in JBoss

    rcostanzo

      I am noticing some strange behavior with my JBoss 3.2.6 cluster of 5 instances using apache and mod-jk 1.2.14 over AJP13 to connect. Even when there is virtually no load on the system, the currentThreadsBusy count in the jk-8009 ThreadPool MBean shows a relatively high number.

      For example, if I look at a single point in time, my apaches are processing 40 requests each (including static content which doesn't get passed on to JBoss), and the JBoss instances are reporting 225 threads busy. This seems like impossible math to me since I don't see how apache forwarding say at most 10 requests to JBoss causes 225 threads to become busy.

      The only thing I can think of is that the threads aren't truly busy. When I ran a small load on a test instance and let it finish, I saw 21 threads busy afterwards. I waited hours, and it still said 21 threads busy. I then restarted apache (NOT JBoss), and it dropped to 1 thread busy.

      Is there a known issue with the mod-jk plugin and it making JBoss think its threads are busy when they really aren't? This becomes a major issue for me in production under high loads where I hit my maximum threads very quickly, but the box is under almost no load.

      Any help would be greatly appreciated.

      -Rob

        • 1. Re: Too many threads being marked as busy in JBoss
          starksm64

          The keep alive and connection timeout settings are simply keeping a thread dedicated to the ajp requests. Adjust them if you want the connections to be closed after inactivity.

          • 2. Re: Too many threads being marked as busy in JBoss
            rcostanzo

            Thanks for the reply. How do I adjust the keep alive and connection timeout settings? Are these configurations for Tomcat or of mod JK?

            Here's a snippet from my workers.properties with the timeout configs I've already implemented:

            worker.maintain=60

            # Define a worker using ajp13
            worker.webapp6.port=8009
            worker.webapp6.host=mateso-webapp6
            worker.webapp6.type=ajp13
            worker.webapp6.lbfactor=1
            worker.webapp6.disabled=0
            worker.webapp6.stopped=0
            worker.webapp6.socket_timeout=300
            worker.webapp6.recycle_timeout=60
            worker.webapp6.reply_timeout=300000

            • 3. Re: Too many threads being marked as busy in JBoss
              javarako

              You can adjust the configuration in jboss-3.2.6\server\aProject\deploy\jbossweb-tomcat50.sar\server.xml


              Connector port="8788" address="${jboss.bind.address}"
              maxThreads="300" minSpareThreads="25" maxSpareThreads="75"
              enableLookups="true" redirectPort="8443" acceptCount="100"
              connectionTimeout="60000" disableUploadTimeout="true" maxKeepAliveRequests="1"
              proxyName="availability.cingular.net" proxyPort="8080"


              • 4. Re: Too many threads being marked as busy in JBoss
                rcostanzo

                FYI, I just changed Apache from using the prefork MPM to using the worker MPM (and recompiled the mod jk plugin to no use prefork too) and my thread usage counts on JBoss seems accurate. It went way down. I guess there's some issue with Apache/mod-jk prefork which goes away once using the threaded worker MPM.