E.B.:
> > > 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.
> 
> But it is written as such. It's main loop is like this:
> 
> while (<STDIN>) {
> ...
> }
> 
> So executed outside of Postfix it is a one-time script.

Nope. The above loop handles an arbitrary number of greylist queries,
until it sees EOF on the standard input stream.

The other end of this stream is connected to one Postfix SMTP daemon
process that sends an arbitrary number of queries in the course of
time. The Perl script terminates when the Postfix SMTP daemon process
terminates; that happens typically after 100 SMTP sessions or after
100 seconds of idle time. These numbers are configurable.

If you want to know if there is a relevant performance difference,
then you will have to do measurements. You can use Postfix's
smtp-source and smtp-sink tools to generate and absorb SMTP load.

I expect that a multi-threaded implementation will use a bit less
memory and a bit more CPU, but the difference will be a drop in a
bucket compared to the cost of Postfix queue management.

        Wietse

Reply via email to