Why is my Tomcat 6 worker thread pool not being used by the connector?

My server.xml looks like this:

<!--The connectors can use a shared executor, you can define one or more named thread pools-->
<Executor  name="tomcatThreadPool" 
           namePrefix="catalina-exec-"
           maxThreads="200" 
           minSpareThreads="4"/>

<Connector executor="tomcatThreadPool"
           port="8080" protocol="HTTP/1.1"
           connectionTimeout="10000"
           maxKeepAliveRequests="1"
           redirectPort="8443" />

<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />

      

However in Tomcat manager ( http: // localhost / manager / status ) it shows the following

http-8080: Max threads: -1 Current thread count: -1 Current thread busy: -1
jk-8009: Max threads: 200 Current thread count: 4 Current thread busy: 1

      

It looks like http-8080 does not use an executor even if directed too, and jk-8009 uses an executor even if not directed. Is the dispatcher just wrong or has it configured the thread pool incorrectly?

+2


a source to share


2 answers


My guess is that the manager reports the values ​​that were set as part of the connector definitions, and does not report the values ​​from the executor. The performer is working as expected, it just isn't reported correctly in the manager.

The 200 value for the AJP connector is misleading as 200 is the default value for maxThreads

(as defined here ); because you did not specify maxThreads

for the AJP connector, this is the value that is used.



The HTTP connector communicates meaningless values ​​because it delegates flow control to the executor.

To check if this is all true, try changing the maxThreads

executor value to a different value. You should see the maxThreads

AJP connector staying at 200 (as this is the default).

+5


a source


The maximum number of request processing threads that must be created by this Connector, which determines the maximum number of concurrent requests that can be processed. If not specified, this attribute is set to 200. If an executor is associated with this connector, this attribute is ignored because the connector performs tasks using the executor rather than an internal thread pool. Note, if an executor is configured, any value set for this attribute will be written correctly, but reported (via JMX, for example) as -1 to make it clear that it is not being used.



0


a source







All Articles