On Sat, Sep 09, 2000 at 12:29:36PM -0700, Bill Moseley wrote:
> At 11:15 PM 09/08/00 +0200, Stas Bekman wrote:
> >On Fri, 8 Sep 2000, Bill Moseley wrote:
> >> I just looked at my old mail sending module a few days ago that uses
> >> sendmail and would fallback to Net::SMTP if sendmail wasn't available (it
> >> was running on Win at one point, argh!).  I just removed the Net::SMTP
> >> part.  Are you saying that I removed the wrong code?
> 
> >> At 10:31 AM 09/08/00 +0200, Stas Bekman wrote:
> >
> >As Perrin has suggested, benchmark it an see what's faster. It's so
> >simple.
> 
> <somewhat joking>
> 
> Benchmark: timing 1 iterations of SMTP, Sendmail...
>     SMTP: 60 wallclock secs ( 0.03 usr +  0.00 sys =  0.03 CPU) @ 33.33/s
> (n=1)
>          (warning: too few iterations for a reliable count)
> Sendmail:  0 wallclock secs ( 0.00 usr  0.00 sys +  0.01 cusr  0.01 csys =
>          0.02 CPU)
>          (warning: too few iterations for a reliable count)
> 
> I guess it isn't a fair test ;)  I had my DNS servers unplugged and used
> -odd with sendmail.  And I guess if I set a timeout of 60 seconds on
> Net::SMTP I better be ready to wait that long.
> 
> </somewhat joking>
> 
> Seriously, though, I can't imagine how to benchmark such a complicated
> thing as sending mail.  I can do it on my machine, I guess, but that
> doesn't tell me how it will work on the live machine that's also sending
> out a mailing list or running a faulty nscd on Solaris that hangs DNS
> requests, or mailing to [EMAIL PROTECTED] and DNS is hopping from DNS to
> DNS to do the lookup.  
> 
> The nscd thing is the reason I moved from using Net::SMTP; SMTP worked
> great most of the time, but really messed things up when the DNS was not
> working.  Forking may or may not be slower, but it like more of a sure bet.
> 
> Have fun,
> 
> 
> 
> 
> Bill Moseley
> mailto:[EMAIL PROTECTED]

All your objections about smtp will be gone if you set up a
dedicated local account just for processing emails from modperl.
Since the account is local, Net::SMTP will get done instantly
and the modperl can get back doing what it is supposed to be doing
instead of waiting for dns resolution, nscd and what not.

So in modperl, you write the real email as the body of email
to the local account, giving it a special subject line such
as "send out the body text". Then you set up procmail or .forward
for that local account so that it will do "sendmail -oi -t" or
whatever to actually send the body of text. It can take as much time
as it wants without interfering the website service.

Richard

Reply via email to