The io mode of Connector can be configured in tomcat server.xml, there are three kinds, normal, nio, apr;
After testing, it was found that:
普通模式时 <Connector port="8080" protocol="http/1.1" .. maxThreads="3" acceptCount="2" ... />
As above, if the maximum number of threads is 3 and the maximum queue is 2, then when the client initiates the sixth request, it will be rejected: connection refused.
nio模式时 <Connector port="8080" protocol="org.apache.coyote.http11.Http11NioProtocol" .. maxThreads="3" acceptCount="2" ... />
Although the maximum number of threads and the maximum queue are configured, even if more than 6 requests, such as 50 requests are initiated, they will not be rejected, but the sixth and later ones are all waiting.