When sending a larger amount of emails using the integrated Email Experience Manager tool, we can come across a situation, when sending can take unusually long. In this article, we will show you how it is possible to find out the current overload of the server that is sending the emails, how quickly individual emails are generated and sent and what the values in the configuration files for EXM are, which make it possible to increase the performance.

The process of creating and sending emails within mass sending using EXM can simply be made of the following steps:

  1. Obtaining the user’s automated state from the Analytics DB
  2. Obtaining the user
  3. Generating the message for the specific user
  4. Sending the generated message

The speed of obtaining automated states for individual users most frequently ranges in the hundreds of thousands per second. You will most likely never have to deal with this number. As a rule, the speed of obtaining users, actually their emails, range in a number of units or tens of obtained records per second. This is once again a value which will most likely not be an obstacle when investigating the slow speed of sending emails.

Let us focus on the time necessary for generating an email message for each user and the time necessary for sending the message.

The generating of messages can once again be divided into several partial parts:

  1. Uploading the user from the DB
  2. Collecting files for composing the message
  3. Composing the email message
  4. Composing the MIME (Multipurpose Internet Mail Extension) header

Every one of these parts requires a certain amount of time for its successful completion. The most difficult of these is composing the email message, which can usually range from 100 -250ms. The others usually range in tens of milliseconds. The total time should not exceed a value of 300ms.

Another significant value is the number of concurrently generated messages. If the number of concurrently generated messages per second is lower (in units), then try increasing the MaxGeneration Threads value in Sitecore.EmailCampaign.config. For utilizing the processor during sending to 50% (which is a safe value, which will not threaten the performance of other applications), the value should be set to twice the number of processor cores.

The time necessary for sending the message is derived from two parameters in the configuration file:

  1. NumberThreads – number of concurrent threads used to sending emails
  2. MaxConnections – number of concurrent connections with the SMTP server

When changing the values in the configuration, it is recommended that these dependencies be followed:

  • The MaxGenerationThreads value should have values of half the CPU cores or the total number of CPU cores or double the CPU cores.
  • The NumberThreads value should be same or higher than the MaxGenerationThreads
  • The SMTP.MaxConnections value should be the same or higher than the NumberThreads

Therefore, the dependency between the configuration values is according to this formula:

½ CPU cores <= MaxGenerationThreads <= NumberThreads <= SMTP.MaxConnections

Here is an overview of all configuration keys, which are related to the set up of the Email Experience Manager performance. You will find them in the Sitecore.EmailCampaign.config file:

&amp;amp;amp;lt;!--The maximum number of concurrent SMTP connections allowed to open--&amp;amp;amp;gt;
&amp;amp;amp;lt;setting name=&amp;amp;amp;quot;SMTP.MaxConnections&amp;amp;amp;quot; value=&amp;amp;amp;quot;100&amp;amp;amp;quot; /&amp;amp;amp;gt;

&amp;amp;amp;lt;!--The number of threads that you can use for sending messages--&amp;amp;amp;gt;
&amp;amp;amp;lt;setting name=&amp;amp;amp;quot;NumberThreads&amp;amp;amp;quot; value=&amp;amp;amp;quot;100&amp;amp;amp;quot; /&amp;amp;amp;gt;

&amp;amp;amp;lt;!--Specifies how many sending threads can generate messages at the same time. Default value: Environment.ProcessorCount * 2--&amp;amp;amp;gt;
&amp;amp;amp;lt;setting name=&amp;amp;amp;quot;MaxGenerationThreads&amp;amp;amp;quot; value=&amp;amp;amp;quot;&amp;amp;amp;quot; /&amp;amp;amp;gt;

&amp;amp;amp;lt;!--The number of recipients in each batch enqueued in the dispatch queue.--&amp;amp;amp;gt;
&amp;amp;amp;lt;setting name=&amp;amp;amp;quot;DispatchEnqueueBatchSize&amp;amp;amp;quot; value=&amp;amp;amp;quot;300&amp;amp;amp;quot; /&amp;amp;amp;gt;

&amp;amp;amp;lt;!--The number of threads that adds recipient batches to dispatch queue.--&amp;amp;amp;gt;
&amp;amp;amp;lt;setting name=&amp;amp;amp;quot;DispatchEnqueueThreadsNumber&amp;amp;amp;quot; value=&amp;amp;amp;quot;2&amp;amp;amp;quot; /&amp;amp;amp;gt;

&amp;amp;amp;lt;!--The amount of time to wait between sending messages (ms)--&amp;amp;amp;gt;
&amp;amp;amp;lt;setting name=&amp;amp;amp;quot;Sleep&amp;amp;amp;quot; value=&amp;amp;amp;quot;0&amp;amp;amp;quot; /&amp;amp;amp;gt;

For monitoring the above described values during the sending emails, it is good to use the EXM Performance Manager Tool, which is run at the following address:

http://hostname/sitecore/admin/dispatchsummary.aspx

The hostname is the name of the server, where Email Experience Manager is run.

The overview running at the stated address looks like this:

ECM Performance measurement tool

This page is not refreshed automatically so if you need to have current data you have to reload it manually.