E.B.:
> Hi, I need create a custom policy service and I have a questions
> about efficiency/performance.
> 
> I found two perl examples that are within my skill to understand
> and one is based from the example code in the Postfix 
> examples/smtpd-policy/greylist.pl if you don't know I think this is
> http://heap.altlinux.org/usr/share/doc/postfix-2.2.11/examples/smtpd-policy/greylist.pl
> so its run by Postfix's spawn service. Perl code itself no threading,
> no forking just like one-time script because Postfix takes care of
> the rest right?

It's not a one-time script. It does not handle one request and
terminate. That would not scale under load.

There is one Perl script interpreter process per Postfix SMTP daemon
process, and it terminates when the Postfix SMTP daemon process
terminates.  Each Postfix SMTP daemon process handles up to 100
SMTP sessions, so the cost of creating the Perl process is very
much reduced compared to a one-time script that handles one request
and terminates.

> Other example, it runs as daemon itself, so Postfix not in charge,
> only makes call to it from smtpd_*_restrictions. See its here:
> https://github.com/bejelith/send_rate_policyd
> 
> I can put 2nd one under systemd so it can be monitored and restart
> if it goes down.
> 
> Question is if there is any major difference in these implementation?
> In high volume situation is one better than other?

That depends on how the non-spawn(8) implementation is done.

        Wietse


Reply via email to