Tomcat 6默认的maxThread,官方文档有错误

  我们前段时间遇到一个很奇怪的问题,Tomcat6使用默认的配置,在进行压力测试时,老是报错,用Jmeter模拟40个用户并发时,正常,当超过60个时,居然全部报错,打开server.xml可以看到如下配置:

 

<Connector port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />

 

Tomcat的官方网站的解释如下, maxThread如果没有set,默认值为200.

 

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.

 

这个就产生问题了,打开Tomcat的源码发现默认值是40,而不是200,所以压力测试时

 

所以遇到同类的问题,大家一定要注意,添加以下配置:

<Connector port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" maxThreads="150"/>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值