为什么连接器不使用我的Tomcat 6执行程序线程池?

jwe*_*gan 2 java tomcat tomcat6 server.xml

我的server.xml如下所示:

<!--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" />
Run Code Online (Sandbox Code Playgroud)

但是,在Tomcat管理器(http:// localhost/manager/status)中,它显示如下

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
Run Code Online (Sandbox Code Playgroud)

由于某种原因,它看起来像http-8080没有使用执行程序,即使它也被指示并且jk-8009正在使用执行程序,即使它没有被指示.经理只是误报或我没有正确设置线程池?

ska*_*man 6

我的猜测是管理器报告的是作为连接器定义的一部分设置的值,而不报告执行程序中的值.遗嘱执行人将按预期工作,但在经理中没有正确报告.

用于AJP连接的200值是误导这里,由于200是作为默认值maxThreads(如定义在这里); 因为您没有maxThreads为AJP连接器指定,所以这是使用的值.

HTTP连接器报告无意义值,因为它将其线程管理委派给执行程序.

要检查是否全部为真,请尝试maxThreads将执行程序的值更改为其他值.您应该看到maxThreadsAJP连接器保持在200(因为这是它的默认值).