andy27367451 发表于 2017-2-4 12:28:02

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 createdby this Connector, which therefore determines themaximum number of simultaneous requests that can be handled.Ifnot specified, this attribute is set to 200. If an executor is associatedwith 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"/>
页: [1]
查看完整版本: Tomcat 6默认的maxThread,官方文档有错误