3 Replies Latest reply on Dec 17, 2015 10:36 AM by qikun zhou

    What is the default thread pool for http connector?

    qikun zhou Newbie

      Environment:

          JBoss EAP 6.4.0 (JBossWeb 7.5.0.Final)

       

      1.There are six built-in Executor classes in EAP 6, what is the default thread pool for http connector? Is the default thread pool among this built-in executors ?  I refered the EAP6's manuals.

      2.In EAP 5, I could monitor the currentThreadsBusy, the number of threads for this connector that are currently active. But in EAP 6, like the similar attribute currentThreadsBusy,how could I monitor the usage of http connector's default thread pool?

        • 1. Re: What is the default thread pool for http connector?
          Jay SenSharma Master

          Internaly executor can not be monitored. However it has some values like default MAX_THREADS value which  is computed as following in EAP6.4  (which uses JBOSSWEB_7_5_0_FINAL )

          MAX_THREADS computation for Java based connector.

                      512 * Runtime.getRuntime().availableProcessors()

           

          1. /**
          2.   * Maximum amount of worker threads.
          3.   */ 
          4.   protected int maxThreads = (org.apache.tomcat.util.Constants.LOW_MEMORY) ? 64 : ((Constants.MAX_THREADS == -1) ? 512 * Runtime.getRuntime().availableProcessors() : Constants.MAX_THREADS); 

           

          See:  http://anonsvn.jboss.org/repos/jbossweb/tags/JBOSSWEB_7_5_0_FINAL/src/main/java/org/apache/tomcat/util/net/JIoEndpoint.java

           

           

           

          If you want to really tune and monitor the threads statistics then you will need to define custom thread pool executor.  It means f you do not want to use the default values then you got the right link which tell us exactly how to create an Executor and how to associate it with the connector:

          https://access.redhat.com/documentation/en-US/JBoss_Enterprise_Application_Platform/6.4/html/Administration_and_Configuration_Guide/sect-Connector_Configuration.htm

           

          Example:

           

                  <subsystem xmlns="urn:jboss:domain:threads:1.1">
                      <bounded-queue-thread-pool name="http-executor" allow-core-timeout="true">
                          <core-threads count="100"/>
                          <queue-length count="100"/>
                          <max-threads count="100"/>
                      </bounded-queue-thread-pool>
                  </subsystem>
          
          
                  <subsystem xmlns="urn:jboss:domain:web:2.2" default-virtual-server="default-host" native="false">
                      <connector name="http" protocol="HTTP/1.1" scheme="http" socket-binding="http" executor="http-executor"/>   <!-- NOTICE -->
                      <virtual-server name="default-host" enable-welcome-root="true">
                          <alias name="localhost"/>
                          <alias name="example.com"/>
                      </virtual-server>
                  </subsystem>
          

           

           

          Then it can be monitored using CLI as following:

           

          [standalone@localhost:9999 /] /subsystem=threads/bounded-queue-thread-pool=http-executor:read-resource(include-runtime=true)
          

           

          Regards

          Jay SenSharma

          • 3. Re: What is the default thread pool for http connector?
            qikun zhou Newbie

            Hi SenSharma

             

            Thanks a lot for your detail reply.

            I refered to this link, I understood. It's JBoss specification that the default thread pool(internal executor)'s runtime attributes can't be monitored.

            I think The default http connector's thread pool is generally the best pool to use for performance, but this pool's runtime attribute(for example currentThreadsBusy) can't be showed at any time.

            Could you tell me more about the reason?