mailer.sh sendmail timeouts hints
Posted: Mon Sep 19, 2011 10:13 am
Hi,
after (almost) successful sending a batch of 150k mails, here's the hint:
$sm -q1m -NNEVER -OQueueDirectory=$BASE/var/spool/QUEUE -OPidFile=$run/sendmail-openemm-queue.pid -OTimeout.connect=5s -OTimeout.queuereturn=1d -OMinQueueAge=5m
and the explanation:
5 sec connect timeout is quite important to avoid about 3 min default system wait (depends on tcp_syn_retries) which that happens if destination host remains silent. Queue processing time of 1 min is quite low and sendmail will never pass by an unresponsive host if you leave it as is. Increasing to i.e. q15m doesn't solve the issue - 5 unresponsive hosts and your mail processing stops anyway. 5 seconds is quite enough for a sane host to respond to connection. It may seem low, but if not responding withing 5 secs, even if not dead, the hosts is overloaded so better don't push it further.
Queue return of one day is there so we don't retry sending 5 days before giving up. One day is reasonable time for any broken mail server to get back up, and also reasonable time to allow you to deliver all your mails. However, watch for "452 Too many recipients received this hour" and such responses - 1d may be too short if you get a lot of these.
Minimum queue age relates to queued message age: once message delivery fails, sendmail will not retry sending for this time. This allows to skip failed messages, but to retry after a while, which is handy for "too many recipients" style responses. Set too low (or using default 0), your mail queue may hang, depending on other timeouts. 5 min age seems optimal with 1m queue processing time.
I'd love to have that in default mailer.sh.
Please let me know how it works for you.
after (almost) successful sending a batch of 150k mails, here's the hint:
$sm -q1m -NNEVER -OQueueDirectory=$BASE/var/spool/QUEUE -OPidFile=$run/sendmail-openemm-queue.pid -OTimeout.connect=5s -OTimeout.queuereturn=1d -OMinQueueAge=5m
and the explanation:
5 sec connect timeout is quite important to avoid about 3 min default system wait (depends on tcp_syn_retries) which that happens if destination host remains silent. Queue processing time of 1 min is quite low and sendmail will never pass by an unresponsive host if you leave it as is. Increasing to i.e. q15m doesn't solve the issue - 5 unresponsive hosts and your mail processing stops anyway. 5 seconds is quite enough for a sane host to respond to connection. It may seem low, but if not responding withing 5 secs, even if not dead, the hosts is overloaded so better don't push it further.
Queue return of one day is there so we don't retry sending 5 days before giving up. One day is reasonable time for any broken mail server to get back up, and also reasonable time to allow you to deliver all your mails. However, watch for "452 Too many recipients received this hour" and such responses - 1d may be too short if you get a lot of these.
Minimum queue age relates to queued message age: once message delivery fails, sendmail will not retry sending for this time. This allows to skip failed messages, but to retry after a while, which is handy for "too many recipients" style responses. Set too low (or using default 0), your mail queue may hang, depending on other timeouts. 5 min age seems optimal with 1m queue processing time.
I'd love to have that in default mailer.sh.
Please let me know how it works for you.