How do Milters and delays "a" play together?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

How do Milters and delays "a" play together?

Patrick Ben Koetter-2
The speed_adjust option for smtpd_proxy_options has a nice side effect. It
effects how Postfix logs delays "a" (a = time from message arrival to last
active queue entry). That's an important feature (to us), because we have SLAs
where the time spent within the MTA must not exceed a certain time.

If I don't enable speed_adjust Postfix will also account the time spent
receiving mail from e.g. slow sending clients. The sending speed is something
we can't control. But it influences the overall time a message seems to have
spent in Postfix. And this leads to problems with SLAs.

If I enable speed_adjust Postfix's accounting is not influenced by behaviour
out of its control. It will start to account only after the entire message has
been received. This way I can easily deduct how long it took from message
arrival until the message was ready to leave the system again.

How does Postfix handle "a" when used in combination with a MILTER? I assume -
without any testing - it will also account the "client factor".

Thanks

p@rick

--
[*] sys4 AG
 
https://sys4.de, +49 (89) 30 90 46 64
Franziskanerstraße 15, 81669 München
 
Sitz der Gesellschaft: München, Amtsgericht München: HRB 199263
Vorstand: Patrick Ben Koetter, Marc Schiffbauer
Aufsichtsratsvorsitzender: Florian Kirstein
 
Reply | Threaded
Open this post in threaded view
|

Re: How do Milters and delays "a" play together?

Viktor Dukhovni
On Tue, Aug 04, 2015 at 01:05:39PM +0200, Patrick Ben Koetter wrote:

> The speed_adjust option for smtpd_proxy_options has a nice side effect. It
> effects how Postfix logs delays "a" (a = time from message arrival to last
> active queue entry). That's an important feature (to us), because we have SLAs
> where the time spent within the MTA must not exceed a certain time.
>
> If I don't enable speed_adjust Postfix will also account the time spent
> receiving mail from e.g. slow sending clients. The sending speed is something
> we can't control. But it influences the overall time a message seems to have
> spent in Postfix. And this leads to problems with SLAs.

The "a" time starts when the queue file is created (empty).  With
proxy filters and speed_adjust, the queue file is created by the
after-proxy SMTP service only after the before-proxy SMTP service
receives the complete message (because the message is buffered).

> How does Postfix handle "a" when used in combination with a MILTER? I
> assume - without any testing - it will also account the "client factor".

Milters don't delay queue file creation.  You can if you like (at
the cost of increased disk I/O load) run the mail through a "null"
proxy (just forward from one smtpd(8) to another smtpd(8) with no
actual proxy in between) and enable the milters in the back-end
SMTP service.  Then the clock again starts when the message is
received.

With good log analysis, and sufficiently large active queue limits
(memory is much larger these days than in 1997) you might also
start the clock from the first "qmgr" entry for a message, but that
requires looking further back in the log.

--
        Viktor.