0 Replies Latest reply on Jul 8, 2009 6:28 AM by rohit.macherla

    Threads and waiting HTTP requests

    rohit.macherla

      Hi,

      I have a doubt regarding the thread processing in JBoss.
      The configuration of BasicThreadPool in jboss-service.xml is as follows:

       <!-- A Thread pool service -->
       <mbean code="org.jboss.util.threadpool.BasicThreadPool"
       name="jboss.system:service=ThreadPool">
       <attribute name="Name">JBoss System Threads</attribute>
       <attribute name="ThreadGroupName">System Threads</attribute>
       <attribute name="KeepAliveTime">240000</attribute>
       <attribute name="MaximumPoolSize">20</attribute>
       <attribute name="MaximumQueueSize">1000</attribute>
       <attribute name="BlockingMode">run</attribute>
       </mbean>
      


      There is also a Connector type for port 8080 which has another configuration for its threads (this is at server.xml in deploy/jboss-web.deployer ) :
       <Service name="jboss.web">
       <Connector port="8080" address="${jboss.bind.address}"
       maxThreads="800" maxHttpHeaderSize="8192"
       emptySessionPath="true" protocol="HTTP/1.1"
       enableLookups="false" redirectPort="8443" acceptCount="100"
       connectionTimeout="20000" disableUploadTimeout="true" />
      


      Our application uses JAX-WS style WebServices that are developed using JAXB on NetBeans IDE 6.0.1. These webservices get requests from external systems and from among the other internal webservices as well.
      I want to know how these both Threads (the one in the BasicThreadPool and the HTTP Connector Thread) relate to each other.

      After our application has been deployed, I have noticed that there are about 800 currentThreadsBusy at a particular time. And when I went to tomcat console (at http://localhost:8080/status), I have found that most of them were waiting at GET requests for one of the webservices.

      Stage Time B Sent B Recv Request
      S 1161886 ms 8 KB 0 KB GET /OurAddressManagement-war/AddressManagementAPIService?wsdl HTTP/1.1
      S 3300470 ms 8 KB 0 KB GET /OurServiceManagement-war/ServiceManagementAPIService
      ......

      The server was reaching its full capacity and the "top" command for the HP UNIX server (this HP UNIX machine hosts the JBoss 4.2.2.GA App server) indicates a CPU usage of 120% (it is a 2 CPU machine).
      As we can see, these HTTP threads were found waiting for a long time (3300470 milliseconds = almost an hour).
      At such high load, when I check the BasicThreadPool, the QueueSize = 0. If so many HTTP threads are waiting, then I anticipated the queue size to be atleast 100. This value of zero is quite inexplicable considering that the MaximumPoolSize is just 20.
      With such high requests, the server is down to its knees and I would like to know what I can do to decrease the processing times of the HTTP threads.

      Thank you for your time.