tomcat connector (conncector) can be configured way NIO IO and NIO todaywere nothing to do on the next test configuration is as follows:
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443"
executor="tomcatThreadPool" />
<Connector port="8080" protocol="org.apache.coyote.http11.Http11NioProtocol"
connectionTimeout="20000"
redirectPort="8443" />
Test two main resources:
Dynamic pages (with database queries, emphasis on IO and cpu)
Static pages (no database operations, mainly on the ability to handle a simplerequest)
The results are as follows:
Dynamic Page
Concurrency 100 200 300 400 600 800
IO 206 215 209 205 210 206
NIO 192 194 189 194 195 191
Static page
Concurrency 100 200 300 400 600 800
IO 941 306 361 361 347 400
NIO 927 313 318 703 286 914
Can be seen indealing with the advantages of dynamic resources NIO is not obvious or even notas good as IO, the main reason is a dynamic resource, IO, and cpu-intensiveoperations, resulting in many requests are blocked on the CPU and IO, it canonly dry socket IO waiting, not to play the advantages of NIO
NIO look at the performance when dealing withstatic, although the unstable but still very significant performanceimprovements, so NIO often used to process the request and deal with them morethan simple applications, such as memcached
原文地址:http://www.codeweblog.com/tomcat-io-performance-comparison-with-nio/