tomcat性能优化的文章很多,但是有很多内容已经过时了。近期因为需要写spring cloud F版
的tomcat优化手册,故记录一下调查内容。
参考:https://tomcat.apache.org/tomcat-8.5-doc/config/http.html
(没有官方依据的优化都是耍流氓)
springBoot2默认提供的tomcat配置:(略去部分不重要的)
server.tomcat.basedir=/tomcat/log
server.tomcat.max-threads=222
server.tomcat.accept-count=100
server.tomcat.max-connections=10000
server.tomcat.max-swallow-size=10m
server.tomcat.accesslog.enabled=true
server.tomcat.min-spare-threads=20
server.tomcat.max-http-post-size=20m
额外解释部分(Spring未提供):
- acceptorThreadCount
The number of threads to be used to accept connections. Increase this value on a multi CPU machine, although you would never really need more than 2. Also, with a lot of non keep alive connections, you m