CRON and BATCHES - POSSIBLE?

Once you've installed phpList Version 2... ask questions here!
Forum rules
Please help the volunteers to help you by supplying the version of phpList you are using, browser & version and if possible, a link to your phpList installation. This is for Version 2 of phpList (the orange one).

CRON and BATCHES - POSSIBLE?

Postby theweddingsite » 2:00pm, Fri 02 Nov, 2007

SORRY I PASTED THIS IN THE WRONG SECTION :(

Hi all.

I have PHPLIST installed and use it to send manually in batches of 30 messages per 60seconds.

However, lately my Host's MYSQL connection has slowed down and it is timing out nearly for every batch. (as they have set a maximum of 60seconds before a script times out)

So I thought that I should trying using it from a CRON job.

Is it possible to have PHPLIST running through CRON but still send in batches? Can anyone please direct me to some good documentation about this topic?

Thanks a lot

Mario
theweddingsite
phpLister
 
Posts: 11
Joined: 9:34am, Tue 01 Jun, 2004

Postby H2B2 » 5:41pm, Fri 02 Nov, 2007

It should be possible but it might get a bit complicated if your server is running PHP-cgi.

You could run a test with batch processing disabled, and rely on the mailqueue_throttle setting to keep within the message limits of your host. For instance to send no more than 30 messages in 60 seconds, you would need to insert a pause of 2 seconds between each message:
Code: Select all
# batch processing disabled:
define("MAILQUEUE_BATCH_SIZE",0);

# Batch_period is not effective when batch processing is disabled:
define("MAILQUEUE_BATCH_PERIOD",3600);

# Pause 2 seconds between messages to send no more than
# 30 messages per minute (=1800 msgs/hr):
define('MAILQUEUE_THROTTLE',2); 


See also:
http://docs.phplist.com/PhpListConfigSendRate
http://docs.phplist.com/PhpInterfacesInfo
http://docs.phplist.com/CronJobExamples
H2B2
Moderator
 
Posts: 7188
Joined: 1:51am, Wed 15 Mar, 2006

Postby theweddingsite » 6:44pm, Fri 02 Nov, 2007

Thanks H2B2.

Yes, I have read those documents earlier on and thought of setting the throttle like that.

What I don't know is how will this work...

I mean let us say I send the message to all my lists, containing 4500 addresses.

I set it with a pause of 2 seconds per message, thus at a speed of 1800 per hour.

Let us say at 4:00pm cron will run. Will it send the whole 4500 emails? Will I need to make cron to run let's say every 30 mins?

Thanks

Mario
theweddingsite
phpLister
 
Posts: 11
Joined: 9:34am, Tue 01 Jun, 2004

Postby H2B2 » 7:30pm, Fri 02 Nov, 2007

Yes, if a timeout hits, the cron job should take up mailqueue processing where it left off and thus keep the process going.

The question is how often you should let the cron job execute. I guess that you'd best run a few tests to find out. You might start off with once every 5 or 10 minutes and see how that works out.
H2B2
Moderator
 
Posts: 7188
Joined: 1:51am, Wed 15 Mar, 2006


Return to Question & Problems - after installing

Who is online

Users browsing this forum: No registered users and 4 guests