6 Replies Latest reply on Jan 11, 2016 11:29 PM by Raja Sekhar

    Thread property set in domain.xml

    Raja Sekhar Newbie

      Hi All,

       

           I am new to the Jboss environment. Kindly suggest me to understand Jboss and use wihtout having any problem.

       

      How to set the thread value domain/standard.xml files?

      How to increase timeout value in jboss as well as how to set the AJP connections value?

       

      Thank and Regards

      Rajasekhar

        • 1. Re: Thread property set in domain.xml
          Jay SenSharma Master

          In order to tune the threads you will need to configure the "executors" as described in the following link:

          Example: Following is an example of HTTP executor, Exactly same approach you can use for the AJP executors.

           

           

          <subsystem xmlns="urn:jboss:domain:web:1.0">

          <connector enable-lookups="false" enabled="true"     

                      executor="http-executor"

                      max-connections="200"

                      max-post-size="2048" max-save-post-size="4096"

                      name="http" protocol="HTTP/1.1"

                      proxy-name="proxy" proxy-port="8081"

                      redirect-port="8443" scheme="http"

                      secure="false" socket-binding="http" />

                      . . .

          </subsystem>

           

          <subsystem xmlns="urn:jboss:domain:threads:1.0">

              <bounded-queue-thread-pool name="http-executor"

                  blocking="true">

                  <core-threads count="10" per-cpu="20" />

                  <queue-length count="10" per-cpu="20" />

                  <max-threads count="10" per-cpu="20" />

                  <keepalive-time time="10" unit="seconds" />

              </bounded-queue-thread-pool>

          </subsystem>

           

           

             Regarding the "timeout" can you please let us know which timeout actually you want to set?  If you are talking about the "keepalive-time" then above is the approach mentioned for the same.

          Reference:

          19.2. Connector Configuration

           

          http://www.mastertheboss.com/jboss-server/jboss-performance/jboss-as-7-performance-tuning?start=3

           

          Regards

          Jay SenSharma

          • 2. Re: Thread property set in domain.xml
            Raja Sekhar Newbie

            Hi Jay,

             

              Thanks for your configuration

             

              I removed bounded-queue-thread-pool from the domain.xml and using AJP configuration like below.Please suggest me how to find out howmany threads i am using for the application now here.

             

            <subsystem xmlns="urn:jboss:domain:web:1.5" default-virtual-server="default-host" native="false">

                            <connector name="http" protocol="HTTP/1.1" scheme="http" socket-binding="http" executor="http-executor"/>

                            <connector name="ajp" protocol="AJP/1.3" scheme="http" socket-binding="ajp" max-connections="5000"/>

                            <virtual-server name="default-host" enable-welcome-root="true">

                                <alias name="localhost"/>

                                <alias name="example.com"/>

                            </virtual-server>

            </subsystem>

             

            Thanks in Advance.

             

            Thanks&Regards

            Rajasekhar

            • 3. Re: Thread property set in domain.xml
              Raja Sekhar Newbie

              Hello All,

               

                     Can someone please look on my request. I will be thankful to anyone who gives the information corresponding to this.

               

              Thanks in Advance.

               

              Thanks&Regards

              Rajasekhar

              • 4. Re: Thread property set in domain.xml
                Jay SenSharma Master

                Hello Rajasekhar,


                    "max-connections" are used to set the max thread pool size of the default java connectors when an executor is not enabled.

                    If the executor is not enabled on the connector the the System Property "org.apache.tomcat.util.net.MAX_THREADS" can be used to control the max threads creation. But we should remember that the "max-connections" set at the connector always takes precedence of this system property.

                 

                    Now as for as monitoring of threads are concerned:

                    >>>> The EAP6 "web" subsystem uses an internal thread pool (by default). Which allows you can define "max-connections" parameter on the connector, which sets the connector's internal thread pool size.  However there is no option available to monitor the  "default internal thread pool".  So if you really want to monitor then you should create a "executor" as mentioned earlier.  Like following:

                 

                
                
                #STANDALONE MODE
                
                /subsystem=threads/bounded-queue-thread-pool=ajp-executor:read-resource(include-runtime=true)
                
                #DOMAIN MODE
                /host=slave-1/server=server-x/subsystem=threads/bounded-queue-thread-pool=ajp-executor:read-resource(include-runtime=true)
                


                 

                 

                 

                ... (Additional Info for other threads monitoring):

                However you can monitor the "jca based workmanager" threads using MBean client tools like JVisualVM or JConsole ...etc  by navigating to the MBean "jboss.as:jca  (default)"

                You can also use the "jboss-cli.sh" command as following for the same purpose.

                 

                 

                [standalone@localhost:9999 /] /subsystem=jca/workmanager=default/long-running-threads=default:read-resource(include-runtime=true)
                {
                    "outcome" => "success",
                    "result" => {
                        "allow-core-timeout" => false,
                        "core-threads" => 50,
                        "current-thread-count" => 0,
                        "handoff-executor" => undefined,
                        "keepalive-time" => {
                            "time" => 10L,
                            "unit" => "SECONDS"
                        },
                        "largest-thread-count" => 0,
                        "max-threads" => 50,
                        "name" => "default",
                        "queue-length" => 50,
                        "queue-size" => 0,
                        "rejected-count" => 0,
                        "thread-factory" => undefined
                    }
                }
                
                
                
                

                 

                In domain mode you can use the following command:

                /host=slave1/server=server-x/subsystem=jca/workmanager=default/long-running-threads=default:read-resource(include-runtime=true)
                
                
                

                 

                 

                Regards

                Jay SenSharma

                • 5. Re: Thread property set in domain.xml
                  Raja Sekhar Newbie

                  Hi Jay,

                   

                  Its useful.

                   

                  Clarify me. I am executing below command to find out the threads usage in my server. I googled it and found the below command. This command will result of Active threads in the server.

                   

                  netstat -olpw | grep <pid>

                   

                  Here i am seeing less than 700 Active threads and near to 400 BLOCKED,WAITING,SLEEPING threads in separately. But my ajp max-connections are 5000, it means i hope its not utilizing that many connections ? but i am facing the issue.

                   

                  My confusion here, I removed Bounded queue so there is no thread configuration and i added ajp connections which i mentioned before. Then how the threads are utilizing and how many default threads are there in the server.

                   

                  Thanks&Regards

                  Rajasekhar

                  • 6. Re: Thread property set in domain.xml
                    Raja Sekhar Newbie

                    Hello All,

                     

                       Anyone can clarify on this?

                     

                    Thanks&Regards

                    Rajasekhar