Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to slow down cfmail

Status
Not open for further replies.

olmos

Technical User
Oct 25, 2000
135
US
I have to send out emails to a list which
then I am using procmail and a unix script
to save the email message that was
sent out to a file on the server.

However, the script seems to not be able to keep up
with all the email that gets sent out through CFMAIL,
sometimes the files do not get created.

Is there a way to slow down the sending of email when
using CFMAIL ?

How do I go about this ?

thanks,
olmos
 
you can run a pointless loop before the mail goes out.

loop
loop
count to 10000
end loop
send mail
end loop

We've heard that a million monkeys at a million keyboards could produce the complete works of Shakespeare; now, thanks to the Internet, we know that is not true.
 
I tried doing the loop and the CPU resources went up and the browser Crashed. so I did some more research and read that cfx_sleep does not take up alot of
CPU resources . I am currently testing it but am having problems getting it to work.

Thanks ,
olmos.
 
There are a few ways to do it that can work great.

cfx_sleep is what we recommend to our clients because it's the easiest, however you may need to increase the timeout on the script to prevent CF from killing it after a certain time.

Another way that I used in the past was to use a meta refresh tag as follows:

Pull lets say 10 records from the database, then set a meta refresh that passes a variable back to the script to say what the last processed record was. When the meta refresh runs, the script takes the variable and then pulls the next 10 records out. This way you can just adjust the meta refresh time to extend the pause and there is no load put on the server during the pause. Neither the script or browser will time out this way either.

Hope this helps

Wullie

Fresh Look - Quality Coldfusion/Windows Hosting

The pessimist complains about the wind. The optimist expects it to change. The leader adjusts the sails. - John Maxwell
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top