From: Kouhei S. <ko...@cl...> - 2011-07-02 04:31:26
|
須藤です。 In <84liwhwd27.wl%og...@ve...> "[milter-manager-users-ja:00151] [GLib] poll(2) failed due to: Invalid argument." on Sat, 02 Jul 2011 12:56:16 +0900, Mitsuru Ogino <og...@ve...> wrote: > この作業のため、プライマリのサーバ mx1 の postfix を止めたのですが、こ > うすると全メールが mx2 の方に集中します。この状態でしばらくたったら、い > きなり mx2 がメールを受信しなくなってしまいました。あわてて mx1 の方の > アップデートを切り戻し、mx2 の方は milter-manager の再起動で現在に至っ > ています。 詳細は↓に書きますが、このときの対応はmilter-managerの再起動 でOKです! > このとき、ログには猛烈な勢いで記録されているようです。 > > Jul 2 11:53:52 mx2 milter-manager[5549]: [GLib] poll(2) failed due to: Invalid argument. > Jul 2 11:53:58 mx2 last message repeated 24479 times > > milter-manger の再起動を /etc/init.d/milter-manager restart で行うと症 > 状は止まりました。 > > 再現を試みるのはちょっと怖いのですが、同じようなことになった方はいらっ > しゃいませんでしょうか。 このログはmilter-managerプロセスが開けるファイルディスクリプ タ数を超えるとでます。Ubuntuなのでおそらくデフォルト値は1024 になっているはずです。milter-managerは Postfix<->milter-manager milter-manager<->milter の接続でそれぞれ1つずつファイルディスクリプタを使います。な ので、5つmilterを使っていると1接続あたり6ファイルディスクリ プタを使うことになります。この場合は、1024 / 6 = 170.XXXより、 同時に170接続くらいあると今回のようなログがでるはずです。 (他にもファイルディスクリプタを使っている箇所があるので、実 際はもう少し接続数は少なくなります。) > サーバは postfix で tarpit (sleep 120 とか) を多用しており、かなりの負 > 荷がかかっていると思われます。最近、迷惑メールが急増しており、postfix > の master.cf で指定する smtpd の maxproc は、デフォルトの 100 では追い > つかなくなっています。 とのことなので、たぶん、↑のファイルディスクリプタ数の制限に ひっかかっているのだと思います。 解決法は、milter-managerプロセスが使用できるファイルディスク リプタ数を増やすことです。 実は、manager.max_file_descriptosという設定項目があって、 root権限でmilter-managerを起動するとmilter-managerプロセスの 最大使用可能ファイルディスクリプタ数を増やしてくれます。 http://milter-manager.sourceforge.net/reference/ja/configuration.html#configuration.manager-max-file-descriptors 注意: milter-managerをrootで起動するときは security.effective_userとeffective_groupも指定して、実際の処 理は一般ユーザ権限で行うようにしてください。 http://milter-manager.sourceforge.net/reference/ja/configuration.html#configuration.security-effective-user http://milter-manager.sourceforge.net/reference/ja/configuration.html#configuration.security-effective-group もし、最初からmilter-managerを一般ユーザで起動しているときは rootで「ulimit -n XXX」をして最大数を大きくした環境下で milter-managerを実行してください。これでも同じ効果が得られま す。 -- 須藤 功平 <ko...@cl...> 株式会社クリアコード <http://www.clear-code.com/> (03-6231-7270) プログラミングが好きなソフトウェア開発者を募集中: http://www.clear-code.com/recruitment/ |