views:

601

answers:

1

My server.xml looks like the following:

<!--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 the Tomcat manager (http://localhost/manager/status) it shows to 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

For some reason it looks like http-8080 isn't using the executor even though it is directed too and jk-8009 is using the executor even though it isn't instructed to. Is the manager just misreporting or have I not setup the thread pool correctly?

+2  A: 

My guess is that the manager is reporting the values that were set as part of the connector defintions, and not reporting the values from the executor. The executor wil work as expected, it's just not reported correctly in the manager.

The 200 value for the AJP connector is misleading here, since 200 is the default value for maxThreads (as defined here); because you didn't specify maxThreads for the AJP connector, this is the value that is used.

The HTTP connector is reporting nonsense values because it's delegating its thread management to the executor.

To check if this is all true, try changing the maxThreads value of the executor to a different value. You should see maxThreads of the AJP connector staying at 200 (because that's its default value).

skaffman
Looks like you're right. Thanks for the help
jwegan