On Fri, Sep 07, 2001 at 04:05:30PM -0400, Chris Shenton wrote:
> PS: If I'm just overlooking something about how to invoke qmail-inject
>     from Perl and not suffer a 0.5 second penalty for each, please let
>     me know.

I think you must be missing something. I thought those numbers sounded
_way_ off, so I did some testing of my own (profile, don't speculate):


gregw@frodo:~$ time bin/qmailtest.pl 

real    25m10.825s
user    0m52.815s
sys     2m5.626s

Where frodo is a Pentium-133 non-MMX, 128MB EDO, 6GB EIDE.

gregw@aragorn:~$ time bin/qmailtest.pl 

real    13m0.627s
user    0m3.844s
sys     0m29.733s

Where aragorn is a PentiumIII-600MHz, 512MB SDRAM, queue on 9GB SCSI (along
with the rest of /var, /home, and /usr/local)

And bin/qmailtest.pl reads like so:


#!/usr/bin/perl -wT

# Simple test to see how fast perl and qmail-inject are.

$ENV{"ENV"} = "" ;
$ENV{"PATH"} = "" ;

my $inject = "/var/qmail/bin/qmail-inject" ;
my $counter = 0 ;
my $total = 6000 ;

my $from_address = 'From: <hostmaster>' ;
my $to_address = 'To:<hostmaster>';
my $subject = 'Subject:Testing qmail-inject+perl speed' ;
my $data = 'This is a test of qmail-inject speed.' ;


while ( $counter <= $total )
        {
        open(INJECT, "|$inject") || die "Cannot open qmail-inject pipe!\n";
        print INJECT "$from_address\n$subject\n$to_address\n\n$data\n";
        close INJECT ;
        $counter ++ ;
        }
exit 0 ;

(I simply dumped hostmaster to a local garbage address for the purpose
of this test).

So, for aragorn, I got 13m*60=780s for 6000 deliveries -- that's ~7.7
deliveries/sec -- this is a system completely unsuited to the task of
high volume mail delivery, and I've certainly not spent any time,
effort, or cash to ensure that mail delivery is quick... Where did that
0.5 deliveries/sec come from? Is it what you were injecting?

(N.B. -- flames regarding my programming style or skill go directly to
/dev/null -- I'm not a coder, and do not pretend to be. :)  )

-- 
Greg White

Reply via email to