简体   繁体   English

Amazon Ses 电子邮件发送速度非常慢

[英]Amazon Ses emails going very slow

I am trying to send about 28000 email using Amazon SES, but the problem is the emails are going very slow in last 7 hours only 8000 emails were delivered, i have setup a cron job to run the script on the server side to send emails, which was triggered 8 in the morning, and now about 15:23 emails are still going.我正在尝试使用 Amazon SES 发送大约 28000 封电子邮件,但问题是电子邮件在过去 7 小时内发送速度非常慢,仅发送了 8000 封电子邮件,我已经设置了一个 cron 作业来在服务器端运行脚本以发送电子邮件,这是早上8点触发的,现在大约15:23的电子邮件还在继续。

I am using phpMailer to send emails through amazon using smtp.我正在使用 phpMailer 使用 smtp 通过亚马逊发送电子邮件。 How can i make this process to work faster, are there some measures i should undertake?我怎样才能使这个过程更快地工作,我应该采取一些措施吗?

I have already tried curl to send emails using SES api.我已经尝试 curl 使用 SES api 发送电子邮件。 But same results.但同样的结果。 My limits are 50000 Emails a day, with delivery of 14/Sec emails.我的限制是每天 50000 封电子邮件,发送 14 封电子邮件。

Amazon says that mail send rates, which are not especially fast at a max rate of 70 per second (* edit: apparently the rate varies depending on the user ), will be slow if you are using a single thread to create a connection to send mail.亚马逊表示,邮件发送速率不是特别快,最大速率为每秒 70 次(*编辑:显然速率因用户而异),如果您使用单线程创建要发送的连接会很慢邮件。 They suggest that in order to achieve a higher sending rate per second you should use multithreading which will allow you to create several threads which in turn creates several connections for email delivery.他们建议,为了获得更高的每秒发送速率,您应该使用多线程,这将允许您创建多个线程,进而创建多个用于电子邮件传递的连接。

For how to handle multithreading in PHP there are a number of good answers here on SO on how to implement it (or something like it, anyway).关于如何在 PHP 中处理多线程,这里有很多关于如何实现它(或类似的东西,无论如何)的很好的答案。

You can also put up to 50 addressees in the "Destinations" property when sending via the API.通过 API 发送时,您还可以在“目的地”属性中放置最多 50 个收件人。 This would allow you to batch in blocks of 50 per email.这将允许您批量处理每封电子邮件 50 个。 That is, if you can actually do that.也就是说,如果你真的可以做到这一点。 Obviously the emails would have to be the same and not customized per email address.显然,电子邮件必须相同,而不是针对每个电子邮件地址进行定制。

Another idea would be to spin up a couple more worker nodes to get out these emails.另一个想法是启动更多的工作节点来获取这些电子邮件。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM