On Tue, Jul 26, 2011 at 3:47 PM, /dev/rob0 <[email protected]> wrote:
> postscreen(8) protects smtpd(8), not smtp(8). Bots are not a problem
> for the latter. You might want to take some time to review this:
>    http://www.postfix.org/OVERVIEW.html

Hi, Rob. Thanks for the quick reply. And cool - learned something
already. Thanks. That makes sense.

> http://www.postfix.org/QSHAPE_README.html
> http://www.postfix.org/TUNING_README.html#mailing_tips

QSHAPE is one tool we were already using, and the good news is that
even during a send process (one of which is going on right now), the
active queue is generally very small. Like so:

                                         T  5 10 20 40 80 160 320 640 1280 1280+
                                  TOTAL  9  9  0  0  0  0   0   0   0    0     0
                              yahoo.com  3  3  0  0  0  0   0   0   0    0     0
                              gmail.com  2  2  0  0  0  0   0   0   0    0     0
                              ymail.com  2  2  0  0  0  0   0   0   0    0     0
                               yahoo.in  1  1  0  0  0  0   0   0   0    0     0
                            hotmail.com  1  1  0  0  0  0   0   0   0    0     0

And here's the qshape deferred output on our fallback relay:

                                         T  5 10 20 40 80 160 320 640 1280 1280+
                                  TOTAL 25  2  2  1  3  8   6   0   0    0     3
                                 abv.bg  3  0  0  0  1  2   0   0   0    0     0
                       www.facebook.com  3  0  0  0  0  1   0   0   0    0     2
                              tmail.com  2  1  0  0  1  0   0   0   0    0     0
                            myemail.com  2  0  0  0  0  2   0   0   0    0     0
                                 at.net  1  0  0  0  0  0   1   0   0    0     0
                               bebo.com  1  0  0  0  0  1   0   0   0    0     0
                               2323.com  1  0  0  0  0  1   0   0   0    0     0
                              umail.com  1  0  0  0  1  0   0   0   0    0     0
                              tahoo.com  1  0  0  0  0  0   1   0   0    0     0
                             global.net  1  0  0  0  0  0   0   0   0    0     1
                            gotmail.com  1  0  0  0  0  0   1   0   0    0     0
                           100gmail.com  1  0  0  0  0  0   1   0   0    0     0
                           earthlik.net  1  0  0  1  0  0   0   0   0    0     0
                          gamerbeta.com  1  0  0  0  0  0   1   0   0    0     0
                         123hotmail.com  1  0  0  0  0  0   1   0   0    0     0
                         etu.unistra.fr  1  0  1  0  0  0   0   0   0    0     0
                         suddenlink.net  1  0  0  0  0  1   0   0   0    0     0
                        msps.vic.edu.au  1  1  0  0  0  0   0   0   0    0     0
                     landgate.wa.gov.au  1  0  1  0  0  0   0   0   0    0     0

We've been through the General Delivery tips section of the TUNING_README:

- Read and understand the maildrop queue, incoming queue, active queue
and deferred queue discussions in the QSHAPE_README document.
- In case of slow delivery, run the qshape tool as described in the
QSHAPE_README document.

The queue looks good and empties quickly.

- Submit multiple recipients per message instead of submitting
messages with only a few recipients.

We do this one, because each message is unique (has to have an
individual unsub link and contains the subscriber's name)

- Submit mail via SMTP instead of /usr/sbin/sendmail. You may have to
adjust the smtpd_recipient_limit parameter setting.

SwiftMail is submitting via SMTP.

- Don't overwhelm the disk with mail submissions. Optimize the mail
submission rate by tuning the number of parallel submissions and/or by
tuning the Postfix in_flow_delay parameter setting.

As far as parallel submissions, we're only doing three at a time
(three SwiftMail processes sending at a time). Our in_flow_delay
parameter is set to 0. We aren't receiving a lot of mail on this box,
so I'm not sure that delay would even kick in if it were set to the 1s
default. Beyond this, we're not sure how to check to see if the disk
is being "overwhelmed with mail submissions."  Out iowait% is 0.23, so
the CPU isn't waiting for the disk. How else can we tell if we're
overwhelming the disk?

- Run a local name server to reduce slow-down due to DNS lookups. If
you run multiple Postfix systems, point each local name server to a
shared forwarding server to reduce the number of lookups across the
upstream network link.

- We run unbound on our main mailer, and the fallback_relay points to
it, as well.

- Reduce the smtp_connect_timeout and smtp_helo_timeout values so that
Postfix does not waste lots of time connecting to non-responding
remote SMTP servers.

Our smtp_connect_timeout is 10s and our smtp_helo_timeout is 60s.

- Use a dedicated mail delivery transport for problematic
destinations, with reduced timeouts and with adjusted concurrency. See
"Tuning the number of simultaneous deliveries" below.

We're not really seeing problematic destinations. The mail is getting
delivered right away when we attempt to deliver. it's just that our
attempts don't seem to happen very quickly.

- Use a fallback_relay host for mail that cannot be delivered upon the
first attempt. This "graveyard" machine can use shorter retry times
for difficult to reach destinations. See "Tuning the frequency of
deferred mail delivery attempts" below.

We're using a graveyard, and so our qshape deferred output on the main
mailer is empty.

- Speed up disk updates with a large (64MB) persistent write cache.
This allows disk updates to be sorted for optimal access speed without
compromising file system integrity when the system crashes.

I don't quite understand this one, but we're not sure how much of an
issue it is since it appears the system isn't waiting for IO.

- Use a solid-state disk (a persistent RAM disk). This is an expensive
solution that should be used in combination with short SMTP timeouts
and a fallback_relay "graveyard" machine that delivers mail for
problem destinations.

As stated, this is an "expensive solution," so we're trying to rule
everything else out before entertaining it.

The machine we're running on is a dual-proc 3Ghz machine, with 3GB of
memory, and we've got .5GB free when all three SwiftMail processes are
sending, and no swap being used:

top - 17:12:36 up 85 days, 20:48,  5 users,  load average: 2.09, 2.55, 2.75
Tasks: 228 total,   4 running, 224 sleeping,   0 stopped,   0 zombie
Cpu(s): 53.2%us,  1.6%sy,  0.0%ni, 44.9%id,  0.0%wa,  0.0%hi,  0.3%si,  0.0%st
Mem:   3115136k total,  2634640k used,   480496k free,   248664k buffers
Swap:  5177336k total,        0k used,  5177336k free,  1544692k cached

Before we just blindly throw bigger hardware at the issue, we'd still
love some ideas to help research what else could be slowing us down.

Thanks,

SteveJ

Reply via email to