keep-alive introduction and configuring in Tomcat

Source: Internet
Author: User

The keep-alive feature makes the client-to-server connection persistent, and when a subsequent request to the server occurs, the Keep-alive feature avoids establishing or re-establishing the connection. Most Web servers on the market, including Iplanet, IIS, and Apache, support HTTP keep-alive. This feature is often useful for websites that provide static content. However, there is another problem with heavier sites: while retaining open connections for customers has some benefits, it also affects performance because the resources that could have been freed during the processing pause are still occupied. When the Web server and application server are running on the same machine, the Keep-alive feature has a particularly significant impact on resource utilization. This feature is a preset for HTTP 1.1, and HTTP 1.0 plus the Keep-alive header can also provide the persistent function of HTTP.
Keep-alive:timeout=5, max=100
Timeout: Expires 5 seconds (the parameter in the corresponding httpd.conf is: keepalivetimeout), Max is a maximum of 100 requests, forcing the connection to be disconnected
is a new connection in timeout time, and Max will automatically minus 1 until 0, forcing it to break.
The related settings in Tomcat, in the connector element in Server.xml.
KeepAliveTimeout:
After this time the connection is close, the unit is milliseconds
Maxkeepaliverequests:

The maximum number of long connections (1 is disabled, 1 means no limit, the default is 100). Generally set between 100~200).


maxkeepaliverequests= "1" prevents Tomcat from producing a large number of time_wait connections, which in some way avoids the ability to feign death.

keep-alive introduction and configuring in Tomcat

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.