注意点
网上看博客都是maxConnections+acceptCount,其实tomcat容器会建立maxConnections+acceptCount+1连接,超过这个数量外的连接才会返回Connection Refused错误。
可以看官方文档中说明:When this number has been reached, the server will accept, but not process, one further connection. This additional connection be blocked until the number of connections being processed falls below maxConnections at which point the server will start accepting and processing new connections again.
当连接数到达最大连接数时会额外接受一个连接,只不过不会被处理,一直阻塞直到最大连接数低于maxConnections 后这个连接才会被处理。
官方文档:tomcat官方文档