如果Tomcat发现Maximum number of threads (200)错误,很可能并发数超出
解决方案
使用线程池,用较少的线程处理较多的访问,可以提高Tomcat的处理请求的能力
Tomcat_home/conf/server.xml
<Executor name="tomcatThreadPool" namePrefix="catalina-exec-"
maxThreads="500" minSpareThreads="20" maxIdleTime="60000" />
最大线程数500,最小空闲数20,最大空闲时间60秒
<Connector executor="tomcatThreadPool"
port="80" protocol="HTTP/1.1"
connectionTimeout="20000"
keepAliveTimeout="15000"
maxKeepAliveRequests="1"
redirectPort="443"
URIEncoding="utf-8"
/>