MaxKeepAliveRequestsディレクティブ:KeepAliveが有効なときに受け付け可能なリクエストの数

MaxKeepAliveRequests ディレクティブは KeepAlive が有効なとき、一回の接続で受け付け可能なリクエストの数を設定します。ここでは Apache の MaxKeepAliveRequests ディレクティブの使い方について解説します。

※ 「KeepAliveディレクティブ:HTTP KeepAliveを有効にする」も併せて参照されてください。

(Last modified: )

MaxKeepAliveRequestsディレクティブの使い方

MaxKeepAliveRequests ディレクティブは KeepAlive が有効なときに一回の接続で受け付け可能なリクエストの数を設定します。書式は次のとおりです。

MaxKeepAliveRequests リクエストの数

記述できる場所は httpd.conf, VirtualHost です。

デフォルトでは 100 に設定されています。例えば 50 に変更する場合は次のように記述してください。

MaxKeepAliveRequests 50

httpd.conファイルでの記述

KeepAliveTimeout ディレクティブについては httpd.conf ファイルではなく extra/httpd-default.conf ファイルに記述されています。

#
# 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

デフォルトでは httpd.conf ファイル内で extra/httpd-default.conf ファイルを読み込んでいません。

# Various default settings
#Include conf/extra/httpd-default.conf

先頭の # を削除して httpd.conf ファイルで extra/httpd-default.conf ファイルを読み込むように変更したうえで、 extra/httpd-default.conf ファイルで MaxKeepAliveRequests ディレクティブの設定を変更するか、直接 httpd.conf ファイルのいずれかの場所に MaxKeepAliveRequests ディレクティブの設定を記述してください。

-- --

Apache の KeepAliveTimeout ディレクティブの使い方について解説しました。

( Written by Tatsuo Ikura )

Profile
profile_img

著者 / TATSUO IKURA

プログラミングや開発環境構築の解説サイトを運営しています。