Four kinds of Tomcat Connector compare the performance of HTTP protocol based on HTTP protocol Connector performance comparison of Tomcat four

 

Today saw the four in the osc comparison of Tomcat Connector performance based on HTTP protocol

Details are as follows:


<Connector port="8081" protocol="org.apache.coyote.http11.Http11NioProtocol"                           connectionTimeout="20000" redirectPort="8443"/>
<Connector port="8081" protocol="HTTP/1.1" connectionTimeout="20000"
               redirectPort="8443"/>
<Connector executor="tomcatThreadPool"
               port="8081" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />
<Connector executor="tomcatThreadPool"
               port="8081" protocol="org.apache.coyote.http11.Http11NioProtocol"
               connectionTimeout="20000 " Let us put the four kinds of Connector in the order named NIO, HTTP, POOL, NIOP
               redirectPort =" 8443 "/>



In order to prevent other factors that affect the test results, we have only a very simple test jsp page, this page is only output a Hello World. Assuming that address is http: //tomcat1/test.jsp

we turn the four Connector test, test client is done with the ab command on another machine, the test command: ab -c 900 -n 2000 http: //tomcat1/test.jsp, the final test results shown in the following table (units: the average number of requests processed per second):


the NIO the HTTP NIOP the POOL
281 is 208 65 365
666 66 110 398
692 65 263 66
256 94 459 63 is
440. 67 145 363

is easy to see from these five groups of data, HTTP performance is very stable, but also the worst of it, this is the default configuration of Tomcat. NIO volatile manner, but no less than 280, NIOP is added on the basis NIO thread pool, the program may be more complex, and thus the performance is not necessarily stronger than NIO; POOL embodiment is volatile and, during the test and HTTP same way as, from time to time there is stagnation.

Because of the default linux kernel limits the maximum number of open files is 1024, so the number of concurrent control in 900.

Although this is a result because of various factors lead to the actual site, it may be not such a big difference, for example, is limited by the performance of the database, and so the issue. But when we deploy the application or website with a reference value.

 

<Connector
executor="tomcatThreadPool"
port="8090"
redirectPort="8443"
protocol="org.apache.coyote.http11.Http11NioProtocol"
compression="on"
compressionMinSize="2048"
enableLookups="false"
acceptCount="1000"
URIEncoding="UTF-8"
connectionTimeout="40000" />
 

The connector uses the thread pool's name: executor = "tomcatThreadPool" 
connector port: port = "8090" 
transmission connectors used: protocol = "org.apache.coyote.http11.Http11NioProtocol" 
supports compression transmission: compression = "on" 
compressed size: compressionMinSize = "2048"

<Executor name="tomcatThreadPool" namePrefix="catalina-exec-" 
        maxThreads="800" minSpareThreads="400" maxSpareThreads="700"/>

Thread Pool name: name = "tomcatThreadPool" 
thread prefixes: namePrefix = "catalina-exec-"
The maximum number of threads generated: maxThreads = "800"

Minimum initial current number of processes: minSpareThreads = "400" 

maximum initial current number of processes: minSpareThreads = "700"

Source: Tomcat Connector compare the performance of four based on the HTTP protocol

Guess you like

Origin www.cnblogs.com/xiaoshen666/p/11118193.html