7 Replies Latest reply on Sep 11, 2013 1:06 AM by Santy Avinash

    How configure maxThreads in AS 7.1 ?

    Claudio Miranda Expert

      Hi I tried to find out where to configure maxThreads in AS 7.1 but was unable to perform it.

       

      So I ask, how to configure maxThreads for the http/ajp connector ?

      Admin Guide and HA Guide at https://docs.jboss.org/author/display/AS7/High+Availability+Guide doesn't help.

       

       

      [standalone@127.0.0.1:10099 connector=http] pwd /subsystem=web/connector=http [standalone@127.0.0.1:10099 connector=http] ls -l ATTRIBUTE          VALUE     TYPE    bytesReceived      0         INT     bytesSent          0         INT     enable-lookups     false     BOOLEAN enabled            true      BOOLEAN errorCount         0         INT     max-post-size      2097152   INT     max-save-post-size 4096      INT     maxTime            0         INT     processingTime     0         INT     protocol           HTTP/1.1  STRING  redirect-port      8443      INT     requestCount       0         INT     scheme             http      STRING  secure             false     BOOLEAN socket-binding     http      STRING  virtual-server     undefined LIST    CHILD MIN-OCCURS MAX-OCCURS ssl   n/a        n/a        [standalone@127.0.0.1:10099 connector=http] :read-children-names {     "outcome" => "failed",     "failure-description" => "JBAS014746: child-type may not be null",     "rolled-back" => true } [standalone@127.0.0.1:10099 connector=http] :read-children-types {     "outcome" => "success",     "result" => ["ssl"] } [standalone@127.0.0.1:10099 connector=http]
        • 1. Re: How configure maxThreads in AS 7.1 ?
          Claudio Miranda Expert

          I see at [1] that the attribute "max-connections" serves two purporse the max number of connections and the max number of threads.

           

          But that attribute is not available for AS 7.1 standalone.

           

          [standalone@127.0.0.1:10099 connector=http] pwd
          /subsystem=web/connector=http
          
          [standalone@127.0.0.1:10099 connector=http] ls -l
          ATTRIBUTE          VALUE     TYPE    
          bytesReceived      0         INT     
          bytesSent          0         INT     
          enable-lookups     false     BOOLEAN 
          enabled            true      BOOLEAN 
          errorCount         0         INT     
          max-post-size      2097152   INT     
          max-save-post-size 4096      INT     
          maxTime            0         INT     
          processingTime     0         INT     
          protocol           HTTP/1.1  STRING  
          redirect-port      8443      INT     
          requestCount       0         INT     
          scheme             http      STRING  
          secure             false     BOOLEAN 
          socket-binding     http      STRING  
          virtual-server     undefined LIST    
          
          CHILD MIN-OCCURS MAX-OCCURS 
          ssl   n/a        n/a        
          

           

          * this forum html editor doesn't wrap <pre> code.

           

          1. http://docs.jboss.org/jbossweb/7.0.x/config/http.html

          • 2. Re: How configure maxThreads in AS 7.1 ?
            Fabrizio Benedetti Novice

            Hi Claudio,

             

            I noticed that if you want to set the max number of connections supported by http/s connectors, you should manually set the attribute max-connections in standalone.xml. After that, it will appear in the attributes list.

             

            It would be usefull to know what is the default value.

            • 3. Re: How configure maxThreads in AS 7.1 ?
              Claudio Miranda Expert

              Your suggestion worked, thanks!

               

              max-connection can also be see in mbean

              jboss.as:subsystem=web,connector=http

               

              but, it is empty if no previous configuration is done.

              • 4. Re: How configure maxThreads in AS 7.1 ?
                Fabrizio Benedetti Novice

                I analyzed source code and, if I understood correctly, default maxThreads should be (from org.apache.tomcat.util.net.JIoEndpoint):

                 

                this.maxThreads = (org.apache.tomcat.util.Constants.LOW_MEMORY ? 64 : 512 * Runtime.getRuntime().availableProcessors());
                

                 

                In other words:

                • if you set system property "-Dorg.apache.tomcat.util.LOW_MEMORY=true", maxThreads = 64
                • otherwise maxThreads = 512 * Runtime.getRuntime().availableProcessors()

                 

                Regards

                /Fabrizio

                • 5. Re: How configure maxThreads in AS 7.1 ?
                  Santy Avinash Newbie

                  Hi,

                   

                  Apologies to jump on this thread.

                   

                  I also wanted to know who to set max connection timeout for the threads or any timeout configuration

                   

                  Help will be appreciated

                   

                  Regards

                  • 6. Re: How configure maxThreads in AS 7.1 ?
                    Claudio Miranda Expert

                    You can use java properties

                     

                    org.apache.coyote.ajp.DEFAULT_CONNECTION_TIMEOUT   

                    org.apache.coyote.ajp.DEFAULT_KEEP_ALIVE_TIMEOUT

                     

                    The default value is 60000 ms.

                    • 7. Re: How configure maxThreads in AS 7.1 ?
                      Santy Avinash Newbie

                      Hi Claudio,

                       

                      Thank you for the reply.

                       

                      I am not a java developer and need to understand how to set these values in java properties.

                       

                      When you say use java properties, is it something that has to be set in the our application code ?

                       

                      Apologies if this is a silly question, your reply will be appreciated

                       

                      Regards