Apache2.4 winnt_mpmの設定に関するメモ

カテゴリ : Other
公開日 : 2021/07/07 更新日 : 2021/07/07

個人的結論

Apache BenchやApache JMeterで負荷を与え、 tasklistコマンドでメモリ消費量を監視し、ThreadsPerChildの値を調整する。 MaxConnectionsPerChildはThreadsPerChildと同値にする。 (メモリ消費量が測りやすいため)

<IfModule mpm_winnt_module>
    # ThreadsPerChildを1920以上にする場合設定が必要
    ThreadLimit              1921

    ThreadsPerChild          1921
    MaxConnectionsPerChild   1921

    # IE10/11のバグ対策
    AcceptFilter http        none
    AcceptFilter https       none
    EnableSendfile           off
    EnableMMAP               off
</IfModule>

コマンド

Apache Bench

ab -n 総リクエスト数 -c 同時リクエスト数 URL

tasklist

見るべきなのは子プロセス。(大抵メモリ消費量の大きい方) tasklist /fi "imagename eq httpd.exe"

その他

  • 子プロセスはMaxConnectionsPerChildのリクエスト数まで膨れ上がる。
  • MaxConnectionsPerChild + 1 のリクエストで新しい子プロセスを生成し、古い子プロセスは終了する。
  • MaxConnectionsPerChildの設定値までリクエスト投げtasklistで確認、調整する。
  • windowsの場合、mpmの選択肢はwinnt_mpm以外ないと思って良い。
    ソースからコンパイルすればあるいは…とあった気がするようなしないような。
  • Apache JMeterについては他をあたってください。

Share

Blogger : rice

Twitter GitHub

SAP
DOP