postfix3.0のStress設定を有効にする (大量にエラーを出すSMTPクライアントを遅くする)


ArchLinux + Postfix3.0

問題

see http://www.postfix.org/STRESS_README.html for examples of stress-adapting configuration settings
service "submission" (587) has reached its process limit "100": new clients may experience noticeable delays
to avoid this condition, increase the process count in master.cf or reduce the service time per client

ググってみた

http://www.postfix-jp.info/trans-2.3/jhtml/TUNING_README.html
http://www.postfix.org/STRESS_README.html
あたりを読むといいのではないでしょうか。
default_process_limit を大きくするとか。

今の設定確認

$ postconf| grep \^default_process_limit
default_process_limit = 100

この設定値か。

$ postconf| grep stress
address_verify_poll_count = ${stress?{1}:{3}}
postscreen_command_time_limit = ${stress?{10}:{300}}s
postscreen_greet_wait = ${stress?{2}:{6}}s
smtpd_hard_error_limit = ${stress?{1}:{20}}
smtpd_junk_command_limit = ${stress?{1}:{100}}
smtpd_per_record_deadline = ${stress?{yes}:{no}}
smtpd_starttls_timeout = ${stress?{10}:{300}}s
smtpd_timeout = ${stress?{10}:{300}}s
stress =

stress=

今回はこれをyesにすればよいということがわかった。

main.cfへ設定

/etc/postfix/main.cf
+ stress=yes
systemctl restart postfix
確認
$ postconf | grep \^stress
stress = yes

yesになった。様子見する

master.cf に記述する場合

/etc/postfix/master.cf
 # ==========================================================================
 # service type  private unpriv  chroot  wakeup  maxproc command + args
 #               (yes)   (yes)   (yes)   (never) (100)
 # ==========================================================================
 smtp      inet  n       -       n       -       -       smtpd
+    -o stress=yes
 submission inet n       -       n       -       -       smtpd
+    -o stress=yes