![Apache サーバー ログから「[info] server seems busy」を解決するにはどうすればよいですか?](https://rvso.com/image/658839/Apache%20%E3%82%B5%E3%83%BC%E3%83%90%E3%83%BC%20%E3%83%AD%E3%82%B0%E3%81%8B%E3%82%89%E3%80%8C%5Binfo%5D%20server%20seems%20busy%E3%80%8D%E3%82%92%E8%A7%A3%E6%B1%BA%E3%81%99%E3%82%8B%E3%81%AB%E3%81%AF%E3%81%A9%E3%81%86%E3%81%99%E3%82%8C%E3%81%B0%E3%82%88%E3%81%84%E3%81%A7%E3%81%99%E3%81%8B%3F.png)
この質問は何度か見かけましたが、実際の答えがなかったので、私の解決策を投稿することにしました。
以下のinfo
メッセージが apache error.log に表示されます。
[info] server seems busy, (you may need to increase StartServers, or Min/MaxSpareServers), spawning 16 children, there are 41 idle, and 129 total children
答え1
解決策は非常に明白です。StartServers
問題がなくなるまで値を増やしてください。確かにそうですが、意味を理解していない限り、また増加した値が実際に役立つかどうかを理解していない場合は、値を恣意的に増やすのは悪い習慣です。
httpd のソースコードを読んでいたら、次のように書いてありました。
/*
* idle_spawn_rate is the number of children that will be spawned on the
* next maintenance cycle if there aren't enough idle servers. It is
* doubled up to MAX_SPAWN_RATE, and reset only when a cycle goes by
* without the need to spawn.
*/
さらにソースでは、実際のエラーは次の場合にログに記録されます。
if (retained->idle_spawn_rate >= 8) {
ap_log_error(APLOG_MARK, APLOG_INFO, 0, ap_server_conf, APLOGNO(00162)
"server seems busy, (you may need "
"to increase StartServers, or Min/MaxSpareServers), "
"spawning %d children, there are %d idle, and "
"%d total children", retained->idle_spawn_rate,
idle_count, total_non_dead);
}
つまり、このエラーはリクエストを処理するためのサーバーが不足しているため、次のサイクルで生成される子の数が 8 を超える場合。
それで、どうすれば修正できるのでしょうか?
このエラーが発生するたびに、 のようなメッセージが表示されますspawning 16 children
。これは、リクエストを処理するサーバーが不足していたため、16 個の子プロセスを生成する必要があったことを意味します。基本的に、StartServers
エラーがなくなるまで、生成する子プロセスの数だけ を増やします。代わりに をこの量だけ増やすこともできますMin/MaxSpareServers
。