How can I enable keep-alive?

后端 未结 6 1111
醉酒成梦
醉酒成梦 2020-12-28 13:21

I ran a Google Page Speed and it says I scored 57/100 because I need to \"Enable Keep-Alive\" and \"Enable Compression\". I did some Google searches but I c

6条回答
  •  攒了一身酷
    2020-12-28 13:47

    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

提交回复
热议问题