Date: 04/19/06 (PHP Community) Keywords: php, database, sql ...and this is more of a "what's the best way to do this" question. Now, i've discovered that the script is faster than the mail server when it comes to SQL queries, and if I don't put in a usleep(); call in the script, the table will be emptied again by the time the mail server goes to check, which means the mail won't be delivered. I've set the max_execution_time to 60 seconds in php.ini and the usleep to 500000 (half a second), but I'm still not getting any more than 20-something emails sent before the script hits the max_execution_time. I plan on later setting up a cron job to hit the script at regular times (outside work hours, so the mail server is free for our particular mailouts). What's the best value for me to put into usleep to allow the mail server (MDaemon 7.0.1) to collect its information and then let the script go ahead as fast as possible -- you know, the most mail out in the shortest time possible? Just in case I've missed something, is there possible a better way to design this (for version 2)?
|