Tomcat参数之maxThreads

maxThreads参数设置方式

从tomcat官网可以看到,tomcat的conf/server.xml文件中有两个节点可以设置maxThreads参数,下面分别介绍

Connector节点配置

Connector配置maxThreads官网原文如下:
The maximum number of request processing threads to be created by this Connector, which therefore determines the maximum number of simultaneous requests that can be handled. If not specified, this attribute is set to 200. If an executor is associated with this connector, this attribute is ignored as the connector will execute tasks using the executor rather than an internal thread pool. Note that if an executor is configured any value set for this attribute will be recorded correctly but it will be reported (e.g. via JMX) as -1 to make clear that it is not used.
意思是改属性配置了处理并发请求的最大线程数,如果不配置默认值是200. 如果配置了executor属性,这个属性会被忽略。注意斜体部分提到:如果executor设置了值,使用JMX查看的时候这个值会是-1,这是正常的。
Tomcat官网Connector配置地址:https://tomcat.apache.org/tomcat-8.5-doc/config/http.html

Executor节点配置

Executor配置maxThreads官网原文如下:
** (int) The max number of active threads in this pool, default is 200**
这个说得就比较简单了,意思是使用这个线程池来管理tomcat最大线程数,默认值为200。
Tomcat官网Executor配置地址:https://tomcat.apache.org/tomcat-8.5-doc/config/executor.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值