为什么连接器未使用我的Tomcat 6执行程序线程池? [英] Why is my Tomcat 6 executor thread pool not being used by the connector?

查看:120
本文介绍了为什么连接器未使用我的Tomcat 6执行程序线程池?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的server.xml如下所示:

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" />

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

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

由于某种原因,即使http-8080也是直接执行的,它看起来也没有使用执行器,而jk-8009即使没有指示也正在使用执行器.经理只是误报还是我没有正确设置线程池?

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?

推荐答案

我的猜测是,管理器正在报告作为连接器定义的一部分设置的值,而不是从执行程序报告这些值.执行者会按预期工作,只是在管理器中未正确报告.

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.

AJP连接器的200值在这里具有误导性,因为200是maxThreads的默认值(定义为

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.

HTTP连接器正在报告废话值,因为它将线程管理委托给执行者.

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

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

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).

这篇关于为什么连接器未使用我的Tomcat 6执行程序线程池?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆