Copy link to clipboard
Copied
Hi All,
Am using event gateway for sent newsletter email. When I sent large amount of newsletter letters cf mail tag time out occurred.
My mail sent process as follows
Step 1 :
cfloop(query)
{
cfquery for insert recipient to table
}
Step 2:
cfloop(query)
{
cfmail for send mail
cfquery for update table
}
Today I have tried to send 7000 newsletter, I got time out issue in Step 2 cfmail. I have noticed that the insert process in the Spet 1 takes upto 7 minutes for completing(inserting 7000 records).
Am in using MySQL 5 and CF8
Copy link to clipboard
Copied
Step 1 seems odd. Looping through a query implies that you already have the recipient data stored somewhere. Why are you inserting it somewhere else?
Also, what are you updating in Step 2?
Copy link to clipboard
Copied
In Step1:
Recipient list will be queried from a search criteria by the user. This result will be inserted into a table with mail sent flag is FALSE.
In Step 2:
Send mail to each recipient and set that receipt mail sent flag to TRUE
Copy link to clipboard
Copied
Seems kind of odd, but it's your data. In any event, you don't need a loop. Whatever logic you used to select the recipients can also be used for your insert and update queries.
Copy link to clipboard
Copied
ok..
is there any other mechanisum or easy way to insert the recepeint list to a log table. After the mail sent we need to update the log table with mail sent status is TRUE.
One more doubt, why the mysql takes more than 7 minutes to insert 7000 records?
Copy link to clipboard
Copied
Hi
I think you need to go back 1 step.
I had similar issues until i started sending to my lists in batches of 500 every 5 minutes.
I used a scheduled task to reload page and send next 500.
I can no send to databases of 100 000 plus using this method.
Regards
Delon
Copy link to clipboard
Copied
It's taking 7 minutes to add 7000 records because you are making 7000 trips to the database and running 7000 queries. The alternative is to make 1 trip to the database and run one query that adds 7000 records. If you don't know how to do that, I've heard good things about the book, Teach Yourself SQL in 10 Minutes by Ben Forta.