默认是200。
下面看一下详细的配置:
<Connector className="org.apache.coyote.tomcat4.CoyoteConnector" port="8080"
minProcessors="5" maxProcessors="75" enableLookups="true" redirectPort="8443"
acceptCount="100" debug="0" connectionTimeout="20000 " useURIValidationHack="false"
protocolHandlerClassName="org.apache.jk.server.JkCoyoteHandler"/>
解释:
1、MaxProcessors是tomcat能够处理的最大线程数,默认是200.
2、acceptCount一般是>=MaxProcessors,比如是250,表示只有200个在处理,但是还可以接受额外的50个线程,在排队。如果超过250,则直接丢弃。
下面是官方描述:
其中,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.
而acceptCount的介绍为:
The maximum queue length for incoming connection requests when all possible request processing threads are in use. Any requests received when the queue is full will be refused. The default value is 100.
所以两者的默认值分别是200和100。
一个示例配置如下:
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" acceptCount="500" maxThreads="400" />