HTTP keep-alive-sky-blog garden HTTP keep-alive

Source: Internet
Author: User

HTTP keep-alive-sky-blog

HTTP keep-alive

HTTPKeep-Alive

Keep-AliveThis function keeps the client-to-server connection valid. When a subsequent request to the server appears,Keep-AliveFunction to avoid or re-establish a connection. Most Web servers on the market, including iPlanet, IIS, and Apache, Support HTTPKeep-Alive. This feature is usually useful for websites that provide static content. However, for websites with heavy load, there is another problem: Although the benefits of retaining opened connections for customers are also affected, this is because resources that can be released are still occupied during the processing pause. When the Web server and Application Server run on the same machine,Keep-AliveThe function has a particularly significant impact on resource utilization. This function is preset for HTTP 1.1.Keep-AliveThe header can also provide the HTTP continuous function.

Keep-Alive: Timeout = 5, max = 100
Timeout: The expiration time is 5 seconds (corresponding to the parameter in httpd. conf: keepalivetimeout), Max is a maximum of one hundred requests, force disconnection
A new connection is established within the timeout time, and Max is automatically reduced by 1 until it is 0, which is forced to be disconnected. See the following four figures. Note that the value of date is within 5 seconds )!

Related settings in Tomcat are included in the connector element in server. xml.
Keepalivetimeout:
The number of milliseconds this connector will wait for another HTTP request before closing the connection. The default value is to use the value that has been set for the connectiontimeout attribute.

Maxkeepaliverequests:
The maximum number of HTTP requests which can be pipelined until the connection is closed by the server. setting this attribute to 1 will disable HTTP/1.0Keep-Alive, As well as HTTP/1.1Keep-AliveAnd pipelining. setting this to-1 will allow an unlimited amount of Pipelined orKeep-AliveHTTP requests. If not specified, this attribute is set to 100.

HTTPKeep-Alive

Keep-AliveThis function keeps the client-to-server connection valid. When a subsequent request to the server appears,Keep-AliveFunction to avoid or re-establish a connection. Most Web servers on the market, including iPlanet, IIS, and Apache, Support HTTPKeep-Alive. This feature is usually useful for websites that provide static content. However, for websites with heavy load, there is another problem: Although the benefits of retaining opened connections for customers are also affected, this is because resources that can be released are still occupied during the processing pause. When the Web server and Application Server run on the same machine,Keep-AliveThe function has a particularly significant impact on resource utilization. This function is preset for HTTP 1.1.Keep-AliveThe header can also provide the HTTP continuous function.

Keep-Alive: Timeout = 5, max = 100
Timeout: The expiration time is 5 seconds (corresponding to the parameter in httpd. conf: keepalivetimeout), Max is a maximum of one hundred requests, force disconnection
A new connection is established within the timeout time, and Max is automatically reduced by 1 until it is 0, which is forced to be disconnected. See the following four figures. Note that the value of date is within 5 seconds )!

Related settings in Tomcat are included in the connector element in server. xml.
Keepalivetimeout:
The number of milliseconds this connector will wait for another HTTP request before closing the connection. The default value is to use the value that has been set for the connectiontimeout attribute.

Maxkeepaliverequests:
The maximum number of HTTP requests which can be pipelined until the connection is closed by the server. setting this attribute to 1 will disable HTTP/1.0Keep-Alive, As well as HTTP/1.1Keep-AliveAnd pipelining. setting this to-1 will allow an unlimited amount of Pipelined orKeep-AliveHTTP requests. If not specified, this attribute is set to 100.

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.