Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Controlling e-mails sent per hour

by rob_au (Abbot)
on Feb 06, 2004 at 05:26 UTC ( #326998=note: print w/ replies, xml ) Need Help??


in reply to Controlling e-mails sent per hour

One change which I would make would be the following which implements a variable sleep such that the sending of mail is more evenly timed to match 15 second intervals - I have used something similar for a dispatch of mail to our (many thousand) local users in order to stagger the load on the mail server.

eval "use Time::HiRes qw( time sleep )"; foreach (@{ $userinfo }) { my $time = time(); ... sleep 15 - ((time() - $time) % 15); }

However, if you are employing sendmail as a local MTA, you may be interested in taking a look at vthrottle which is a rate throttling mechanism for Sendmail implemented via the milter interface (which can also be interfaced in Perl by way of Sendmail::Milter or PMilter). This may constitute a longer term solution for your mail throttling.

 

perl -le "print unpack'N', pack'B32', '00000000000000000000001011000000'"


Comment on Re: Controlling e-mails sent per hour
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://326998]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (9)
As of 2015-07-08 06:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (96 votes), past polls