Optimizing Mail Lists

Document ID: 10054

Synopsis

Optimization is currently done by editing the registry. Optimization can be done based on the following scenarios.

More Information

Optimizing Mail Lists

Optimization is currently done by editing the registry. Optimization can be done based on the following scenarios.

Using Database Lists where members are sorted by domain:

In HKEY_LOCAL_MACHINE\Software\Rockliffe\MailSite\Lists\"ListName"
Create a REGDword value of (Decimal): MaxRecipients
This will help address the common errors received when sending mail to remote systems which have limited the number of "RCP To: per session.
When a message is sent to a list, it is "delivered" into the list's directory. If MaxRecipients is 0 or absent, the list processor creates one new message file (with added headers, footers etc), which it places in the incoming directory, and creates one corresponding RCP file, containing all the list members, and places it in the same directory.

If MaxRecipients is non-zero (say 100), the list processor creates multiple identical messages (named e.g. B0000123456-000001.MSG etc), and multiple RCP files, such that there are no more than 100 recipients of each message. Thus if there are 160000 members on the mail list, the mail list processor will create 1600 MSG files and 1600 RCP files in the incoming directory.

Optimizing SMTP:

In HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SMTPDA\Parameters MsgLimit1 and DomainLimit1 (both decimal values) come into play when messages are moved out of incoming into holding, at which time the domain directories are created. Normal operation (with both parameters set to 0) is like this:

  • the RCP file for a message is read from incoming.
  • for each recipient, a domain directory is created (if it does not already exist), and the recipient is written to an RCP file located in the directory.
  • the MSG file is moved from incoming to holding
  • the RCP file in incoming is deleted The above steps are executed for each message in the incoming directory.
Suppose there are a large number of messages for one domain (as there will be if you have a mail list with a large number of members in the same domain, and MaxRecipients is non-zero). We would like multiple threads to deliver these messages in parallel, to improve throughput. The delivery system creates one thread per directory, so we need a way of creating multiple directories for the same domain.

The answer is the MsgLimit1 property. Suppose this is set to 50. During the process of moving the messages from incoming to holding, when the number of RCP files in a particular domain directory reaches 50, a new domain directory is created, and RCP files for subsequent messages are written in there. The first domain directory for aol.com is called aol.com, and subsequent domain directories are called aol.com$1, aol.com$2, etc. When each of these reaches 50, a new directory is created.

The problem with this approach is that you could end up with a huge number of directories and a huge number of threads. So, we introduce a second property called DomainLimit1. This is the maximum number of domain directories which may be created for a particular domain. If this is set to 10, then when ten directories (aol.com, aol.com$1, ..., aol.com$9) have been created, subsequent RCP files will be written to one of those directories (the directory which has fewest RCP files in it), rather than create a new directory.

The process of moving the messages from incoming into holding is most efficient when MsgLimit1 is 0 (i.e. no limit on the number of messages in a domain directory, so no other domain directories will be created). The more domain directories there are, the more work has to be done to determine which directory to use for a particular message. So, the combination of a large number of messages, a large number of domain directories, and a small MsgLimit1 value, will cause the incoming-holding process to be slow.

For the numbers you specified and assuming there are many different domains you need to connect to, the following settings would apply:

  1. MaxRecipients - 100 (for the list)
  2. MsgLimit1 - 5 (for SMTP)
  3. DomainLimit1 - 20 (for SMTP)
As a reminder from above mentioned, sort your database by domain. This will also increase performance tremendously.

Optional Setting:

Specify a maximum number of threads, used by MailSite will enhance the over all performance of SMTPDA by setting the following Registry key MaxDeliveryThreads.

  • HKEY_Local_Machine\Software\Rockliffe\MailSite
  • Add a New Key Value = REGDWORD
  • Key name = MaxDeliveryThreads

    Description:

    Each domain to which messages are being sent is handled by its own thread in SMTPDA. Threads are created as needed, when it is time to retry a domain. When there are a large number of domains to be dealt with (e.g. when a message is sent to a large mail list), this will result in a large number of threads being created, which may impact the performance of the system. The MaxDeliveryThreads configuration parameter allows you to specify a maximum number of threads. Once this limit is reached, new threads will no longer be created. When a thread has finished its work with one domain, it will be given another domain to work on. (See also the MsgLimit1 and DomainLimit1 values in the SMTPDA key.) Default: 50.

    In order to increase SMTP Delivery performance when using the SQL Connector, follow the steps below:

    WARNING!!

    Incorrectly editing the Database can damage the server, please be sure you know what you are doing.

    1. Open MS SQL Server Manager
    2. Open the Tree from Microsoft SQL Servers\SQL Servers Group\Local\Databases\MailSite\Tables
    3. Right Click on 'MailServerProperties' in the left pane and select 'Open Table' then 'Return All rows'.
    4. At the very bottom of the returned results put these entries into the fields that are represented in the first row -
    ServiceName PropertyName ServerRoleId PropType PropIntValue
    SMTPDA DomainLimit1 0 4 (See above for guidance)
    SMTPDA MsgLimit1 0 4 (See above for guidance)
    SERVER MaxDeliveryThreads 0 4 (See above for guidance)

    To Alter the MaxRecipients you will need to change the properties in a different Table below is where this is located. The Table below will only show the needed details to locate the Mail-List and change this property

    1. Open the Tree from Microsoft SQL Servers\SQL Servers Group\Local\Databases\MailSite\Tables
    2. Right Click on 'MailListProperties' in the left pane and select 'Open Table' then 'Return All rows'.
    3. At the very bottom of the returned results put these entries into the fields that are represented in the first row -
    MailListID MaxRecipients
    (See Below how to obtain this for the given MailList) (See above for suggested values)

    To obtain the MailListID for the given Mail List follow these steps

    1. Open the 'MailNames' table and return the top section of the rows
    2. Click on the SQL button and use the below example to find the given List :-
    3. SELECT * FROM MailNames WHERE (MailName = 'Example')

    4. This will then return the properties of the mail list. From that you can use the MailListID to locate the list in the 'MailListProperties'. If you have quite a number then use the this select statement to find the list :-
    5. SELECT * FROM MailListProperties WHERE (MailListId = '-2147483233')