PR

DebianでApacheのprefork設定箇所はどこへ?

サーバが重く top コマンドで Apache のプロセス数を見ると、コンソールを埋め尽くすプロセス数である。さすがにプロセス数を制限しなければと思い MaxRequestWorkers の設定箇所を探すのだが見つからない。Apacheの設定ファイル /etc/apache2/apache2.conf を開いて見るのだが prefork の設定がどこにもない。

prefork は使ってないのかと apachectl -V してみると prefork である。

# apachectl -V
……
Server MPM: prefork

あちこち見ていると /etc/apache2/mods-enabled にも *.conf ファイルがあったので、モジュールごとに設定ファイルが分けてあるのかと、mods-enabled ディレクトリ内を見てみると mpm_prefork.conf という、いかにもな名前のファイルを発見し開いてみる。

# vim /etc/apache2/mods-enabled/mpm_prefork.conf

ここに prefork の設定を発見。

<IfModule mpm_prefork_module>
  StartServers            5
  MinSpareServers         5
  MaxSpareServers         10
  MaxRequestWorkers       150
  MaxConnectionsPerChild  0
</IfModule>
  • Debian 8
  • Apache 2.4

コメント