Apache's keepalive and KeepAliveTimeout

Source: Internet
Author: User
In Apache's httpd.conf, keepalive refers to keeping the connection active, similar to a permanent connection to MySQL.     In other words, if keepalive is set to on, then requests from the same client do not need to be connected again, to avoid the burden of adding a new connection to the server each time it is requested. KeepAlive connection Active time is of course limited by KeepAliveTimeout.     If the time between the second request and the first request exceeds KeepAliveTimeout, the first connection is interrupted and a second connection is created. Therefore, in general, the image of more sites should be keepalive set to ON.     But the number of seconds KeepAliveTimeout should be set is a question worth discussing. If the keepalivetimeout is set for too short a time, for example set to 1 seconds, then Apache will frequently establish new connections, of course, will consume a lot of resources, in turn, if the keepalivetimeout set too long, for example, set to 300 seconds,     Then there must be a lot of useless connections in Apache that will take up the resources of the server, and it's not a good thing.     So, in the end to set the keepalivetimeout to how much, depends on the site traffic, the configuration of the server depends.     In fact, this is a bit similar to the MySQL mechanism, keepalive equivalent to mysql_connect or mysql_pconnect,keepalivetimeout equivalent to wait_timeout. Here is my configuration: KeepAlive on KeepAliveTimeout 3 consider that there are quite a few pictures on my website, so KeepAlive is set to ON, the General page two times the request interval will not exceed 3 seconds, so this setting, to the best health turn from: http:/ /edu.cnzz.cn/newsinfo/17275.aspx

Apache's keepalive and KeepAliveTimeout

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.