Microsoft KB Archive/264891

= SMTP Queue Backup Occurs Due to Delivery Threads Attempting to Connect to Unavailable Hosts =

Article ID: 264891

Article Last Modified on 6/16/2006

-

APPLIES TO


 * Microsoft Commercial Internet System 2.0

-



This article was previously published under Q264891



SYMPTOMS
If a remote SMTP host responds slowly due to system processing or connectivity delays, Microsoft Commercial Internet System (MCIS) 2.0 administrators may encounter mail delivery problems that can affect the entire MCIS installation. All ISATQ threads are blocked while trying to connect to a mail host that is unavailable or slow to respond. IP address resolution through DNS lookup may terminate successfully, but the host may not respond in a timely or expected manner. Mail delivery effectively stops for a significant period of time and the queue directory backs up.



CAUSE
A small number of unresponsive hosts may be able to cause all ISATQ delivery threads to block connection attempts. Adjustments made to the SMTP MaxConnectionsToDomain parameter do not help, as this does not limit the number of connection attempts, only the number of SMTP sessions to remote hosts.



WORKAROUND
To start delivering mail, restart SMTP by issuing the following commands:

Net stop smtpsvc

Net start smtpsvc



RESOLUTION
A supported fix is now available from Microsoft, but it is only intended to correct the problem that is described in this article. Apply it only to computers that are experiencing this specific problem. This fix may receive additional testing. Therefore, if you are not severely affected by this problem, Microsoft recommends that you wait for the next Commercial Internet System service pack that contains this hotfix.

To resolve this problem immediately, contact Microsoft Product Support Services to obtain the fix. For a complete list of Microsoft Product Support Services phone numbers and information about support costs, visit the following Microsoft Web site:

http://support.microsoft.com/default.aspx?scid=fh;EN-US;CNTACTMS

NOTE: In special cases, charges that are ordinarily incurred for support calls may be canceled if a Microsoft Support Professional determines that a specific update will resolve your problem. The typical support costs will apply to additional support questions and issues that do not qualify for the specific update in question.

The English version of this fix should have the following file attributes or later:

  Date      Time   Version       Size    File name     Platform - 07/20/2000 11:37a  5.5.1877.53   533,776 Smtpsvc.dll   x86



STATUS
Microsoft has confirmed that this is a problem in Commercial Internet System version 2.0.



New Parameters Provided by the Hotfix
To provide a mechanism to limit the usage of delivery threads for remote hosts, the following parameters have been added to MCIS SMTP. This provides a limit to the number of remote queue delivery threads that can be used to perform delivery operations. As a result, not all of the mail routing delivery threads can become blocked when performing remote mail operations.

To enable the server, type the following Smtpmd.exe commands at a command prompt, and then press the ENTER key:

smtpmd set smtpsvc/1/RoutingThreads 15

RoutingThreads Default: 8

smtpmd set smtpsvc/1/MaxRemQThreads 10

MaxRemQThreads Default: 4

NOTE: To ensure that local threads are available for delivery, MaxRemQThreads must be significantly less than the total number of RoutingThreads. Furthermore, MaxPoolThreads is configured globally for the IIS system, which includes all threads that draw from the ISATQ thread pool, including SMTP.

SMTP Message Retrying
The queue directory begins to fill with e-mail message files with .eml extensions. SMTP retry threads place retry files (*.rtr for remote delivery and *.ltr for local delivery) into the queue directory. Delivery of the .eml files are then retried from the queue. By default, this timer is quite high. For the remote queue, this is set to 60 minutes and only four messages are processed by a retry thread. This is a significant period of time for a retry thread to wait in order to initiate the retrying of delivery. To set these intervals to a lower value, the following parameters can be modified by performing these steps:
 * 1) From the MMC, select SMTP Site Properties.
 * 2) Click the Delivery tab.
 * 3) Specify a lower value for Retry Interval (minutes): 5.
 * 4) Specify a significant value for Maximum retries: 48 (default).

SMTP Limit Connections per Domain and Connection Timeout
SMTP delivery threads are limited to a maximum number of concurrent connections per domain based on the MaxConnectionsToDomain parameter. There is also a connection timeout that determines how long the connection will be attempted. It is important to use these parameters in order to limit the potential for SMTP queue backup due to threads blocking on an attempt to connect to an unavailable host.

Without the hotfix in place, if the site becomes unresponsive, by default, multiple concurrent threads can attempt to connect and deliver messages to this host. Even with the hotfix in place, the MX record is used to determine if this parameter is exceeded. As a result, if a site is represented by multiple hosts (for example, site1.com and site2.com), then the limit must be reached for each, for example, 2 x MaxConnectionsToDomain. The IIS Maxpoolthreads are available through ISATQ for delivery threads. With threads blocking, delivery to other working hosts are impacted. This is detrimental to SMTP mail delivery. The following parameters can be configured:
 * 1) From the MMC, select SMTP Site Properties.
 * 2) Click the SMTP Site tab.
 * 3) Enable Limit connection per domain option.
 * 4) Specify a reasonably low number for the limit (for example, 2).
 * 5) Specify a reasonable Connection time out (seconds): 60 (600 default).

The &quot;Limited to&quot; parameter available in the dialog box specifies the total number of concurrent outbound connections. Set this value to the number representing the total of all connections to remote domains.

Performance Monitor Counters Available
With the hotfix installed, the following counters include successful connections, as well as connections that are in the process of being attempted or timing out. You can monitor these parameters to determine the total remote host connection requirements for all domains that an SMTP server connects to:

Object:

SMTP Server

Counters:

Outbound connections current

Outbound connections total

Errors Logged through Regtrace
NOTE: If the limit is exceeded, ERROR_REMOTE_SESSION_LIMIT_EXCEEDED is set and an error message is logged through Regtrace. This is also a warning that hosts are not accessible. If after retrying the message, the host remains inaccessible, the message NDRs.

The following message may be logged for each failed message delivery attempt:

... this, &quot;user 'username@site.com' is failed connection&quot;

The following message may also be logged if MaxConnectionsToDomain is exceeded:

Max connection reached for Baddomain.com

This is logged for the Remoteq.cxx source. Filtering can be done in order to identify this, which helps to detect a slow or unresponsive remote host.

Keywords: kbhotfixserver kbqfe kbbug kbfix kbqfe KB264891

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.