Re: [PHP] Re: Mass Mailing Using PHP

2004-09-29 Thread Manuel Lemos
Hello,
On 09/28/2004 03:54 AM, Roger Thomas wrote:
You may just need to tune qmail to maximize the number of
simultaneous deliveries according to the available bandwidth.

How do I tune qmail in that manner ? If the answer is too long and
complicated, pls flame me softly as this is already OT.
Usually, increasing the concurrencyremote control option is what makes 
most of the difference. The default is 20 simultaneous deliveries. You 
can increase to 120 without patching qmail. If you realize that such 
change exhausts your memory, you may have to use a smaller value.

Using a DNS query caching daemon also helps if your DNS is a little slow 
to react.


For this reason, during deliveries of messages to many recipients,
it is better to pause once in a while to let the queue be fully
processed and do not stall other programs.

Do you mean, say we fetched 100,000 addresses from database, we make
our script sleep for a while after sending, say 1000 mails ?
Right, you need to test with qmail-qstat how long it needs to rest to 
give qmail time to process all queued messages during a period. This is 
may also be important if your available disk space is limited.

--
Regards,
Manuel Lemos
PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/
Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: Mass Mailing Using PHP

2004-09-28 Thread Paul Bissex
On Tue, 28 Sep 2004 14:54:24 +0800, Roger Thomas <[EMAIL PROTECTED]> wrote:
> Quoting Manuel Lemos <[EMAIL PROTECTED]>:
> > For this reason, during deliveries of messages to many recipients, it is better to 
> > pause once in a while to let the queue be fully processed and do not stall other 
> > programs.
> 
> Do you mean, say we fetched 100,000 addresses from database, we make our script 
> sleep for a while after sending, say 1000 mails ?

An alternative solution is to insert a small delay using usleep()
after each message is sent such that the queue never gets overfull to
begin with. Also, keep in mind you are dealing with multiple possible
constraints -- local resource limitations (CPU & disk), and bandwidth
available for connecting to remote hosts.

For reference, I do this kind of thing on a fairly busy server, using
Postfix, for nonprofit clients that do member newsletter mailings in
the 5,000 to 10,000 piece range. I find that I am able to keep system
load tolerably low by limiting my script to about 3-4 messages per
second. In my case I am mostly concerned about managing local CPU. The
queue never backs up.

You will also want to look at protecting your script from dying
prematurely by using ignore_user_abort() and set_time_limit() or
equivalents.

If you are sending only a few hundred messages, that shouldn't place
much of a burden on your server, and you may not need to insert any
delay at all.

(Whereas if you are sending 100,000 messages, I'd have to guess you're
a spammer, as any org with a legitimate reason to mail 100K people at
once would be unlikely to be creating this script from scratch and
asking basic questions in php-general. But I could be wrong.)

good luck,

pb

-- 
paul bissex, e-scribe.com -- database-driven web development
413.585.8095
69.55.225.29
01061-0847
72°39'71"W 42°19'42"N

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Mass Mailing Using PHP

2004-09-28 Thread Roger Thomas
Quoting Manuel Lemos <[EMAIL PROTECTED]>:

> You may just need to tune qmail to maximize the number of simultaneous deliveries 
> according to the available bandwidth.

How do I tune qmail in that manner ? If the answer is too long and complicated, pls 
flame me softly as this is already OT.
 
> For this reason, during deliveries of messages to many recipients, it is better to 
> pause once in a while to let the queue be fully processed and do not stall other 
> programs.

Do you mean, say we fetched 100,000 addresses from database, we make our script sleep 
for a while after sending, say 1000 mails ?

--
roger


---
Sign Up for free Email at http://ureg.home.net.my/
---

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Mass Mailing Using PHP

2004-09-27 Thread Manuel Lemos
Hello,
On 09/27/2004 09:02 PM, Roger Thomas wrote:
Just let me know which OS and local mailer (Sendmail, qmail, postfix, 
exim, MS IIS, Exchange, etc..) do you use so I can advise.

What do you recommend for Linux and qmail combination ?
Please advise.
Under Linux qmail or postfix are just fine. You can use the mail 
function and it will use qmail. You may just need to tune qmail to 
maximize the number of simultaneous deliveries according to the 
available bandwidth.

Just keep in mind that qmail will queue every message that it receives, 
either from local clients or incoming via SMTP. This means that your 
incoming and outgoing messages will compete in the same queue. If you 
have urgent messages to send or receive, these may be delayed during 
deliveries to many recipients.

For this reason, during deliveries of messages to many recipients, it is 
better to pause once in a while to let the queue be fully processed and 
do not stall other programs.

--
Regards,
Manuel Lemos
PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/
Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: Mass Mailing Using PHP

2004-09-27 Thread Roger Thomas
Quoting Manuel Lemos <[EMAIL PROTECTED]>:

> Just let me know which OS and local mailer (Sendmail, qmail, postfix, 
> exim, MS IIS, Exchange, etc..) do you use so I can advise.

What do you recommend for Linux and qmail combination ?
Please advise.


--
roger


---
Sign Up for free Email at http://ureg.home.net.my/
---

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php