Possible MailScanner bottleneck

Nick Phillips nwp at LEMON-COMPUTING.COM
Fri Jan 18 18:58:16 GMT 2002


On Fri, Jan 18, 2002 at 03:08:24PM +0000, David Lee wrote:

> My strong suspicion is the code at sendmail.pl, approx line 185:
>     for ($i=0; $i<@Config::SpamNames; $i++) {
>       # Look up $relay in each of the @Config::SpamDomains we have
>       $RBLEntry = gethostbyname("$relay." . $Config::SpamDomains[$i]);
>
> and that it is hanging on "gethostbyname(...)" for a remote site.
>
> In other words, the email throughput of the entire machine can be brought
> to a snail's pace or slower by one DNS lookup.

Sounds likely.

> 1. Multi-threading: allow the mailscanner process to be multi-threaded;

Apparently multithreading is in perl 5.6. I avoid perl 5.6 because it seems
too unstable to me.

A possibly large programming effort, too.


> 2. Multi-processing: allow multiple parallel invocations of mailscanner;

Currently not possible, as you (correctly) remember. I did start thinking
about it a while ago (while I was considering what needed to be locked when
in order to keep MTAs happy), and concluded that while most of what's needed
would be fairly simple, it would be a significant (although probably not
too massive) programming effort. It would however be a massive *testing*
effort.

> 3. Timeout: guard the "gethostbyname(...)" code with a timer.

Perl seems to be breaking on us often enough in the areas where we use timers
already... just ask Julian how scared he got when I suggested playing with
a couple of minor modifications to the code which forks the commercial
scanner (and guards it with a timeout)...

> Thoughts?  (Or have I completely missed something obvious?)

Nothing too obvious. Of the three, I'd only really *avoid* the multithreading.
And that's not based on having any experience of using perl 5.6 to do
multithreading, just based on the number of segfaults I've seen with perl
5.6 vs the number I've seen with perl 5.005.

And then there's getting it tested.
--
Nick Phillips -- nwp at lemon-computing.com
Are you ever going to do the dishes?  Or will you change your major to biology?



More information about the MailScanner mailing list