Dave Green:
> Thanks kindly for your reply
>
> > There is no fundamental reason why pickup->cleanup is slower than
> > smtpd->cleanup (other than different receive_override_options
> > settings in master.cf).
> >
> > However, it is possible that you're sending mail INTO Postfix at
> > a slower rate than expected.
> >
> > Specifically, you are sending mail into Postfix via the loopback
> > interface address. It would be instructive to see if the delay
> > goes away when you use the NON-localhost interface address instead.
>
> Have just tested using an address on an external interface as requested
> and there is no change. Mail received over the external interface from
> remote servers is also subject to slow processing in cleanup but there may
> be concurrent factors at work there. Clearly postfix is capable of
> handling messages with large attachments quickly on this machine as
> evidenced by submissions via pickup, but I'm still stumped as to what may
> be preventing this via smtp.
Can you do some tests with a recent version of Postfix's own stress
testing tool?
On my own machine (FreeBSD 8.0), 168.100.189.3 is the ethernet and
bit-bucket@ is a local alias to /dev/null.
% /usr/bin/time ./smtp-source -t bit-buc...@localhost -l 102400000 168.100.189.3
2.39 real 0.16 user 0.20 sys
% /usr/bin/time ./smtp-source -t bit-buc...@localhost -l 102400000 168.100.189.3
2.37 real 0.15 user 0.20 sys
% /usr/bin/time ./smtp-source -t bit-buc...@localhost -l 102400000 127.0.0.1
2.36 real 0.16 user 0.20 sys
% /usr/bin/time ./smtp-source -t bit-buc...@localhost -l 102400000 127.0.0.1
2.36 real 0.15 user 0.21 sys
As you see I get the same 40Mbytes/sec on both loopback or ethernet
while writing a large message to a queue file, including the final
fsync() to flush the disk.
> > The reason I mention this is that OpenBSD uses a large MTU on the
> > loopback interface (approx. 32 kbytes). If the mail sending app
> > uses a smaller write buffer, then it will experience NAGLE delays
> > of a tenth of a second or so, and that adds up with large messages.
>
> Interesting, I was not aware of this.
Most applications use the standard I/O library which has a typical
4kB buffer size. This is LARGER than the typical ethernet MTU of
1500, but SMALLER than the typical loopback MTU (16-32kB).
So one can have Nagle delays depending on which network interface
is used. Mark Martinec (amavisd-new developer) found this one
a couple years ago. Postfix now checks the MTU size and increases
the I/O buffer size if necessary.
Wietse