同時接続およびPrefork MPMモジュール

同時接続およびPrefork MPMモジュール

サーバーがサポートする同時接続数を確認するためにサーバーをテストしています。私はmy mpm_prefork.conf次のように構成します。

# prefork MPM
# StartServers: number of server processes to start
# MinSpareServers: minimum number of server processes which are kept spare
# MaxSpareServers: maximum number of server processes which are kept spare
# MaxRequestWorkers: maximum number of server processes allowed to start
# MaxConnectionsPerChild: maximum number of requests a server process serves

<IfModule mpm_prefork_module>
    StartServers             5
    MinSpareServers       5
    MaxSpareServers      10
    MaxRequestWorkers     100000
    MaxConnectionsPerChild   0
</IfModule>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

しかし、私のサーバーが約8200の同時接続を受信するとエラーが発生し、Apacheは応答しなくなりました。

[notice] caught SIGTERM, shutting down

サーバーに十分なメモリがあり、余裕があります。

構成大丈夫ですか?変更する必要がありますか?

ありがとう

ベストアンサー1

値も変更する必要がありますServerLimit。 ~からMaxRequestWorkers文書:

スレッド化されていないサーバー(つまり、プリフォーク)の場合、MaxRequestWorkersは要求を処理するために開始されるサブプロセスの最大数に変換されます。デフォルト値は 256 です。これを増やすには、ServerLimitも増やす必要があります。

しかし、そこにメモがあります。サーバー制限文書:

サーバーにコンパイルされる ServerLimit 20000 というハード制限があります。(プリフォークMPM 200000の場合)これは、スペルミスによる悪影響を防ぐことです。この制限を超えて増やすには、mpmソースファイルのMAX_SERVER_LIMIT値を変更してサーバーを再構築する必要があります。

おすすめ記事