简体   繁体   English

aws-ses gem 和群发电子邮件:我是用 1000 个地址的数组调用一次,还是循环 1000 次?

[英]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.我已经设置了 SES,并且正在准备我的应用程序以每次邮件发送 600 - 1000 个地址的大量电子邮件。

I would like to know if I should call the send method once with 1000 emails, or call the send 1000 times with one email each.我想知道我是否应该用 1000 封电子邮件调用一次 send 方法,还是用一个 email 调用 send 1000 次。

Also, I'm on Heroku, with a 30 second execution time.另外,我在 Heroku 上,执行时间为 30 秒。

Thanks.谢谢。

You shouldn't be doing anything remotely intensive as sending 1000 emails in a web response.您不应该做任何远程密集的事情,因为在 web 响应中发送 1000 封电子邮件。 I suggest using the Delayed Job gem.我建议使用延迟作业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.您也不必担心 30 秒的执行时间。

Hope that helps!希望有帮助!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在 Amazon SES 中为 aws-ses gem 创建正确的 access_key_id 和 secret_access_key - Create correct access_key_id and secret_access_key in Amazon SES for aws-ses gem AWS-SES Rails宝石 - AWS-SES rails gems 如何优化ActiveRecord查询并加速在Rails中呈现1000次的HAML部分? - How do I optimize ActiveRecord queries and speed up my HAML partial which is rendered 1000 times in Rails? Geocoder Gem .near可以工作超过1000 - Geocoder Gem .near working for distances over 1000 将宝石字符串机械化为1000个以上的小数 - Mechanize gem string to decimal over 1000 issue 如何批量更新数组中模型的字段? - How do I mass update a field for models in an array? 如何使用rails 2在数组中获取超过1000条记录 - How to take more than 1000 records in array using rails 2 在Rails中存储〜1000个字符串元素数组的首选方法是什么? - What is the preferred way to store a ~1000 element array of Strings in Rails? 您如何 select 1000 个对象的单个组? - How do you select individual groups of 1000 objects? 一旦我的应用程序爬升到> 1000个对象[包含Solr日志],Sunspot-Solr就会减速到野兽 - Sunspot-Solr slowing down to a beast once my Application climbed to > 1000 objects [ Solr Logs Included ]
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM