Saturday, April 07, 2018

email slowdown and possible fixes

From March 24 or 25, our mailing list started having a lot of delays in email sending, especially to gmail.com. Found the following issues:

1. For some gmail emails, the server was trying the ipv6 address, and not able to reach it - like

Mar 25 09:34:15 krishna postfix/smtp[19788]: connect to gmail-smtp-in.l.google.com[2404:6800:4003:c03::1b]:25: Network is unreachable

Mar 25 09:34:28 krishna postfix/smtp[20163]: connect to ASPMX.L.GOOGLE.COM[2404:6800:4003:c02::1b]:25: Network is unreachable

This was probably due to a router change at the Studio.

Did this -
https://support.plesk.com/hc/en-us/articles/213398289-Specifying-Postfix-configuration-of-IPv4-IPv6-protocol-support
ie
adding the option:

inet_protocols=ipv4

to the /etc/postfix/main.cf Postfix configuration file. And then as root,

# postfix reload
# service postfix restart

That worked, the emails went out. But the email sending rate was only around 1000 emails per hour, as reported by
# qshape incoming active deferred

2. A lot of mails were being deferred instead of bounced by gmail, OverQuotaTemp.
cat  /var/log/mail.log | grep OverQuotaTemp | wc -l
5878
PB unconfirmed those emails using
cat /var/log/mail.log | grep OverQuotaTemp | grep 'to=' | grep -o '[[:alnum:]+\.\_\-]*@[[:alnum:]+\.\_\-]*' | sort | uniq -i

Then also for bouncing emails, like
cat  /var/log/mail.log | grep "does not exist"
cat  /var/log/mail.log.1 | grep "does not exist"
cat  /var/log/mail.log.1 | grep "553 Mail from 111.93.16.162 not allowed"
cat  /var/log/mail.log | grep "status=bounced"
cat  /var/log/mail.log.1 | grep "status=bounced"

3. Mails were still going out slowly, with the usage on the internet port being like

Next try was to speed up sending to gmail.com domain, since the other emails were going out OK. Then, added these two lines to /etc/postfix/main.cf - 

maximal_queue_lifetime = 2d
default_destination_concurrency_limit = 100

decreasing lifetime from 5d to 2d and increasing concurrency limit from 20 to 100. That seemed to improve things - the outgoing rate went up to almost the peak rate - 

and from the next day, the emails were going out like









No comments:

Post a Comment