Re: Individual bulk e-mails - performance question
| From: | Per Jessen | Date: | Sun, 31 Aug 2008 10:49:11 +0000 |
| Subject: | Re: Individual bulk e-mails - performance question | ||
| References: | 1 2 3 4 5 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-279133@lists.php.net to get a copy of this message | ||
Robert Cummings wrote:
> On Sun, 2008-08-31 at 12:12 +0200, Per Jessen wrote:
>> Robert Cummings wrote:
>>
>> >> That's easily taken care of. Instead of a cron-job, you could
>> >> have a script running as a daemon, checking for emails to be sent
>> >> every 5mins.
>> >
>> > That's the same as running a cron every 5 minutes except now you
>> > also need to detect if your daemon dies :) On the plus side though,
>> > you eliminate the overhead of starting up the script every 5
>> > minutes :)
>>
>> It is not the same as it will prevent multiple scripts running
>> concurrently in case a batch of emails takes longer that 5 minutes.
>> Checking if the daemon dies - I guess it's a matter of taste or
>> paranoia, but I don't think it's necessary when the script is
>> sufficiently simple:
>>
>> #!/bin/sh
>> while true
>> do
>> <yourscript>
>> sleep 300
>> done
>
> I accomplish the same with cron scripts by using locks with expiry.
There are many ways to skin a cat. I also tend to use cron+locks to
avoid multiple concurrent scripts, but for shorter intervals, I tend to
use the daemon.
/Per Jessen, Zürich