Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Request time out issue with Cfmail

Contributor ,
Mar 01, 2010 Mar 01, 2010

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

1.1K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 01, 2010 Mar 01, 2010

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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Mar 01, 2010 Mar 01, 2010

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 01, 2010 Mar 01, 2010

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Mar 01, 2010 Mar 01, 2010

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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 04, 2010 Mar 04, 2010

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 04, 2010 Mar 04, 2010
LATEST

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources