Tomcat's four connector performance comparisons based on HTTP protocol

Source: Internet
Author: User

Tomcat starts with version 5.5 and supports the following four types of connector configurations, respectively:

<connector port= "8081" protocol= "org.apache.coyote.http11.Http11NioProtocol" Connectiontimeou t= "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"
Redirectport= "8443"/>

Let's just name the above four connector in the order of NIO, HTTP, POOL, NIOP

In order not to let other factors affect the test results, we only test a very simple JSP page, and this page simply outputs a Hello World. Assuming the address is http://tomcat1/test.jsp

We test four kinds of connector in turn, the test client on another machine with the AB command to complete, Test command is: ab-c 900-n http://tomcat1/test.jsp, The final test results as shown in the table (unit: Average number of requests processed per second):

NIO HTTP POOL Niop

281 65 208 365
666 66 110 398
692 65 66 263
256 63 94 459
440 67 145 363

It is easy to see from these five sets that HTTP performance is stable, but it is the worst, and this is the default configuration for Tomcat. NiO is very volatile, but no less than 280, NIOP is on the basis of NIO to join the thread pool, it is possible that the program processing more complex, so the performance is not better than nio, and the pool mode is very volatile, the test period and the same as the http, and occasionally stalled.

Because the Linux kernel default limits the maximum number of open files is 1024, so this concurrency control at 900.

Although this results in the actual site because of various factors, may not be so different, such as limited by the performance of the database and so On. But it's also valuable to us when deploying Web Applications.

From: http://www.javayou.com/diary/143691518

Tomcat's four connector performance comparisons based on HTTP protocol

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.