使用系统网络邮件的批量电子邮件性能 [英] performance of bulk emailing using system net mail

查看:475
本文介绍了使用系统网络邮件的批量电子邮件性能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我被要求寻找到一个大容量邮件器的内联网系统,并希望一些建议。

I have been asked to look into a bulk emailer for an intranet system and wanted some advice.

目前,我们使用System.Net.Mail并同步通过客户自己的SMTP服务器发送的电子邮件,通常微软交换。

Currently we use System.Net.Mail and send the emails synchronously via the customers own smtp server, typically Microsoft exchange.

如果我们让他们发送电子邮件到越来越大的群体会我可能面临什么样的陷阱?我曾经认为我可能需要看看异步送他们,是更快地发送一个电子邮件给大型通讯组列表,而不是电子邮件给每个收件人。

If we were allow them to send emails to larger and larger groups what sort of pitfalls will I likely face? I have considered that I may need to look at sending them asynchronously, is it quicker to send one email to a large distribution list rather than an email to each recipient.

任何意见将大大AP preciated

Any advice would be greatly appreciated

推荐答案

在典型的低量的情况有一些需要在这里考虑的问候计算负载两个计算机系统。

In your typical low volume scenario there are two computer systems that need to be considered here with regards to computing load.

  1. 正在发送电子邮件的计算机(通常为Web服务器)
  2. 在邮件服务器

我个人看到的邮件服务器作为有点黑盒子。我不担心超载,直到它返回报告的问题,然后我调整我的电子邮件超时或发送之间的延迟电子邮件或两者兼而有之。

Personally I see the Mail Server as somewhat of a black box. I do not worry about overloading it until it reports back an issue and then I adjust my email timeout or delay between sending emails or both.

当然,Web服务器不应该陷入了发送大量的电子邮件,甚至最坏的请求的线程不应该被垄断这会产生另外一个问题的数量 - 尺度。因此,这意味着非线程池线程应该用于处理发送的电子邮件。 异步/等待关键字弹簧想到或使用的 SmtpClient.SendAsync

The web server of course should not be bogged down with sending a huge number of emails and even worst the request thread should not be monopolized which would create another problem - scale. This therefore implies that non-threadpool threads should be used to handle the sending of the emails. Async/Await keywords springs to mind or the use of SmtpClient.SendAsync.

我相信,这两个都是妥协,但仍比同步发送电子邮件更好。 Web服务器不应使用在所有发送大量电子邮件。这应该被卸载到另一台计算机(S)专门从事这项工作。

I believe both of these are compromises but still better than sending the emails synchronously. The web server should not be used at all to send large volumes of emails. This should be off-loaded to another computer(s) dedicated to this task.

  • 在应用程序服务器或
  • 电子邮件服务

要得到此方案工作,一种方法需要一个简单而可靠的系统,持续电子邮件请求到一个队列(可以是一个简单的数据库表)和具有应用服务器(邮件服务)弹出队列上,另一端

To get this scenario working, one approach requires a simple but reliable system of, persisting the email request to a queue (could be a simple database table) and having the application server (mail service) pop the queue on the other end.

因此,一个专用的应用程序服务器上的异步发送。

So send asynchronously on a dedicated application server.

我还是不相信这是它的结束。你怎么能快速发送大量的电子邮件。产卵1000线程可能不是一个8核电脑上工作这么好。因此,你的code需要能够处理这种情况的调度电子邮件时,有效地利用现有的处理能力。还有就是我用处理这个场景完美的组件 - 的 MassMailer.NET 。它控制线程的数目,同时还支持在建和自定义队列/库。它建立在其他两个组成部分顶部撰写以及发送电子邮件和调度任务在后台线程的。

I still don't believe that's the end of it. How can you send large volumes of emails quickly. Spawning a 1000 threads might not work out so well on an 8-core computer. Therefore your code needs to be able to handle this scenario of effectively utilizing the available processing power when scheduling emails. There is a component that I use that handles this scenario perfectly - MassMailer.NET. It controls the number of threads and also supports in built and custom queues/repositories. Its built on top of two other components for Composing plus Sending Email and scheduling tasks on background threads.

的商业与事情社会方面

其他的事情要考虑的是你是否希望包括在所有的收件人栏。虽然这需要负载关闭的Web服务器是一个事实,即每个人都收到了邮件将有机会获得收件人列表复杂的问题。对于某些业务流程,包括营销列表,这是一个明确的,不,不。同样使用这种方法时,在内部它可能会导致更多的邮件被发送后来随着人们点击回复至所有按钮(这当然是很常见的在今天的商业环境中)。

The other thing to consider is whether you would want to include all the recipients in the TO field. While this takes the load off of the web server it complicates matters in the fact that everyone receiving the mail will have access to the list of recipients. For some business processes including marketing lists, this is a definite no no. Also when using this method internally it may result in more mails being sent later on as people click the Reply-To All button (this is of course very common in today's business environment).

批量优势

  1. 采用负载断开,因为其只发送一个电子邮件必需的。
  2. 的Web服务器

批量缺点

  1. 在不宜与某些邮件列表用来由于相互冲突的商业利益
  2. 在不经意间导致邮件服务器不必以后再处理更多的电子邮件,由于该回复所有的按钮。

这篇关于使用系统网络邮件的批量电子邮件性能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆