Apacheは、MaxClients設定に達した後にサービスを停止します


11

私は次のようにワーカーMPMで構成されたApacheサーバーを持っています:

<IfModule mpm_worker_module>
    ServerLimit         20
    ThreadLimit         50
    StartServers        3
    MaxClients          1000
    MinSpareThreads     50
    MaxSpareThreads     200
    ThreadsPerChild     50
    MaxRequestsPerChild 10000
</IfModule>

サーバーは、毎日約200万件のリクエストを処理します。リクエストが発生すると、Apacheサーバーは新しい接続の受け入れを停止します(ブラウザーは接続できません)。また、プロセスはプロセスリストに残ります。メモリ使用量は約10%、CPUは0%です。Apacheサーバーは、必要なときにプロセスをリサイクルできなかったようです。

エラーログでクラッシュに関連するものを見つけました。

[Mon Aug 15 12:36:24 2011] [error] child process 11444 still did not exit, sending a SIGKILL
[Mon Aug 15 12:36:24 2011] [error] child process 12090 still did not exit, sending a SIGKILL
[Mon Aug 15 12:36:24 2011] [error] child process 10698 still did not exit, sending a SIGKILL
[Mon Aug 15 12:36:24 2011] [error] child process 12144 still did not exit, sending a SIGKILL
[Mon Aug 15 12:36:24 2011] [error] child process 12032 still did not exit, sending a SIGKILL
[Mon Aug 15 12:36:24 2011] [error] child process 10699 still did not exit, sending a SIGKILL
[Mon Aug 15 12:36:25 2011] [notice] caught SIGTERM, shutting down
[Mon Aug 15 12:37:31 2011] [notice] mod_python: Creating 8 session mutexes based on 20 max processes and 50 max threads.
[Mon Aug 15 12:37:31 2011] [notice] mod_python: using mutex_directory /tmp 
[Mon Aug 15 12:37:31 2011] [notice] Apache/2.2.17 (Ubuntu) mod_python/3.3.1 Python/2.7.1+ mod_ssl/2.2.17 OpenSSL/0.9.8o configured -- resuming normal operations
[Mon Aug 15 15:36:46 2011] [error] server is within MinSpareThreads of MaxClients, consider raising the MaxClients setting
[Mon Aug 15 15:38:48 2011] [error] server reached MaxClients setting, consider raising the MaxClients setting
[Mon Aug 15 16:17:31 2011] [warn] child process 766 still did not exit, sending a SIGTERM
[Mon Aug 15 16:17:31 2011] [warn] child process 767 still did not exit, sending a SIGTERM

何か案は?ありがとう!


キープアライブ設定は何ですか?アプリケーションで何らかのロングポーリングを実行していますか?
— レギレロ

回答:


7

mod_statusを使用してサーバーのステータスを確認することもできます。接続が切断されておらず、「応答の送信」状態(W)でスタックしている場合があります。このSolving httpd maxclientsおよびmodstatusレポートを診断する方法については、この記事を参照してください。

弊社のサイトを使用することにより、あなたは弊社のクッキーポリシーおよびプライバシーポリシーを読み、理解したものとみなされます。
Licensed under cc by-sa 3.0 with attribution required.