KeepAliveは、クライアントからのアクセスをキープして、
以後のアクセスはそのコネクションを利用して送信することで
パフォーマンスを向上させる機能です。
KeepAlive設定は、Apacheの設定ファイルhttpd.confファイルや、
httpd-default.confファイルで行います。
※Apacheのバージョンによって異なります。
下記実行例は、Apache2.2のものです。
# vi /usr/local/apache2/conf/extra/httpd-default.conf
# KeepAlive: Whether or not to allow persistent connections (more than
# one request per connection). Set to "Off" to deactivate.
#
KeepAlive On
↑KeepAliveを利用するには、「On」、利用しない場合は「Off」にします。
# MaxKeepAliveRequests: The maximum number of requests to allow
# during a persistent connection. Set to 0 to allow an unlimited amount.
# We recommend you leave this number high, for maximum performance.
#
MaxKeepAliveRequests 100
↑MaxKeepAliveRequestsは、コネクションあたりで
保持するリクエストの上限を設定します。
# KeepAliveTimeout: Number of seconds to wait for the next request from the
# same client on the same connection.
#
KeepAliveTimeout 5
↑KeepAliveTimeoutは、次のリクエストまでのコネクション保持時間です。
単位は秒になります。
KeepAliveTimeoutは、値が小さいとすぐにコネクションが切れてしまい、
逆に大きすぎると無駄なコネクションが確立されたままになり、
サーバーリソースの浪費につながります。
設定後は、変更内容を反映させる為に、
Apacheの再起動または、設定ファイルの再読み込み処理が必要になります。
・KeepAliveを利用してApacheのパフォーマンスを向上させるのもっと高い技術を身につけたいならこちら
P.S
KeepAliveを利用してApacheのパフォーマンスを向上させるのもっと高い技術を身につけたいならこちら
<<関連記事>>
・MIMEでエンコードされたテキストを読めるように変換する
・viエディタで文字をコピーする
・ハードディスクの使用状況を調べるには
・tar.bz2ファイルを解凍して展開するには
・tar.gz形式のファイルを解凍、展開するには