aws-ses gem and mass emailing: do I call once with array of 1000 addresses, or loop 1000 times?
I have SES setup and am preparing my app to send out mass emailings of 600 - 1000 addresses per mailing.
I would like to know if I should call the send method once with 1000 emails, or call the send 1000 times with one ema开发者_运维百科il each.
Also, I'm on Heroku, with a 30 second execution time.
Thanks.
You shouldn't be doing anything remotely intensive as sending 1000 emails in a web response. I suggest using the Delayed Job gem. It will run the processes in the background by scaling a worker and turning it off when it's done. Since workers are charged per minute, you'll have at most a couple cents per month to pay since your task should be done in less than a minute and shouldn't run all that often. You also won't have to worry about the 30 second execution time.
Hope that helps!
精彩评论