Configure and Enable Apache KeepAlive settings
Configure Apache KeepAlive settings
Open up apache’s configuration file and look for the following settings. On Centos this file is called
httpd.conf and is located in
/etc/httpd/conf. The following settings are noteworthy:
- KeepAlive: Switches KeepAlive on or off. Put in “KeepAlive on” to turn it on and “KeepAlive off” to turn it off.
- MaxKeepAliveRequests: The maximum number of requests a single persistent connection will service. A number between 50 and 75 would be plenty.
- KeepAliveTimeout: How long should the server wait for new requests from connected clients. The default is 15 seconds which is way too high. Set it to between 1 and 5 seconds to avoid having processes wasting RAM while waiting for requests.
Read more about benefits of keep alive connection here: http://abdussamad.com/archives/169-Apache-optimization:-KeepAlive-On-or-Off.html