tomcat配置 连接数(优化)

server.xml中配置
<Connector port="8080"
maxThreads="150"
minSpareThreads="25"
maxSpareThreads="75"
acceptCount="100"
/>
maxThreads="150" 表示最多同时处理150个连接
minSpareThreads="25" 表示即使没有人使用也开这么多空线程等待
maxSpareThreads="75" 表示如果最多可以空75个线程,例如某时刻有80人访问,之后没有人访问了,则tomcat不会保留80个空线程,而是关闭5个空的。

acceptCount="100" 当同时连接的人数达到maxThreads时,还可以接收排队的连接,超过这个连接的则直接返回拒绝连接。

猜你喜欢

转载自xiaotao-2010.iteye.com/blog/1458944
今日推荐