3 Replies Latest reply on Feb 4, 2016 1:13 AM by Jay SenSharma

    What is the default number of threads in JBOSS EAP 6.4?

    safwan hijazi Newbie

      We have web application and web services, we want to know the number of concurrent requests that JBOSS can handle

       

      currently we are using the default configuration used in jboss

        • 1. Re: What is the default number of threads in JBOSS EAP 6.4?
          Jay SenSharma Master

          What is the default thread pool for http connector?    Copying similar discussion here:

           

          Internally 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:

           

          1.         <subsystem xmlns="urn:jboss:domain:threads:1.1"> 
          2.             <bounded-queue-thread-pool name="http-executor" allow-core-timeout="true"> 
          3.                 <core-threads count="100"/> 
          4.                 <queue-length count="100"/> 
          5.                 <max-threads count="100"/> 
          6.             </bounded-queue-thread-pool> 
          7.         </subsystem> 
          8.  
          9.  
          10.         <subsystem xmlns="urn:jboss:domain:web:2.2" default-virtual-server="default-host" native="false"> 
          11.             <connector name="http" protocol="HTTP/1.1" scheme="http" socket-binding="http" executor="http-executor"/>   <!-- NOTICE --> 
          12.             <virtual-server name="default-host" enable-welcome-root="true"> 
          13.                 <alias name="localhost"/> 
          14.                 <alias name="example.com"/> 
          15.             </virtual-server> 
          16.         </subsystem> 
          Then it can be monitored using CLI as following:

           

           

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

          Regards

          Jay SenSharma

          • 2. Re: What is the default number of threads in JBOSS EAP 6.4?
            safwan hijazi Newbie

            could you help me specifying the difference between bounded and unbounded queue, and what is the default timeout for the request coming to JBoss?

            • 3. Re: What is the default number of threads in JBOSS EAP 6.4?
              Jay SenSharma Master

              unbounded-queue-thread-pool: This type of thread pool always accepts tasks. If fewer than the maximum number of threads are running, a new thread is started up to run the submitted task; otherwise, the task is placed into an unbounded FIFO queue to be executed when a thread is available.

               

              bounded-queue-thread-pool: This type of executor maintains a fixed-length queue and two pool sizes: a core size and a maximum size. When a task is accepted, if the number of running pool threads is less than the core size, a new thread is started to execute the task. If space remains in the queue, the task is placed in the queue. If the number of running pool threads is less than the maximum size, a new thread is started to execute the task. If blocking is enabled on the executor, the calling thread will block until space becomes available in the queue. The task is delegated to the handoff executor, if a handoff executor is configured. Otherwise, the task is rejected.

               

              Reference:

              17.3. Connector Configuration

               

              Regards

              Jay SenSharma