Microsoft Exchange Transport service stops and returns Event ID 17018

Summary

The Microsoft Exchange Transport service can repeatedly stop and restart on servers that have a high number of CPU cores and handle heavy mail flow. This issue occurs when the system exhausts the available database sessions due to too many simultaneous server-to-server connections. As a result, Event ID 17018 is logged, indicating insufficient resources and an EsentOutOfSessionsException. To resolve the issue, reduce the number of concurrent inbound connections on Receive connectors and optionally adjust connection limits per source. You can also override server-to-server throttling settings. After you apply these changes, restart the Transport service to restore normal operation.

Symptoms

On a computer running Microsoft Exchange Server that has a high CPU core count and a high transport load, the Microsoft Exchange Transport service continually stops and restarts. Additionally, the following event is logged in the Application log:

Source: MSExchangeTransport
Event ID: 17018
Transport Mail Database: There are insufficient resources to perform a database operation. The Microsoft Exchange Transport service is shutting down.
Exception details: Microsoft.Isam.Esent.Interop.EsentOutOfSessionsException: Out of sessions at Microsoft.Isam.Esent.Interop.Api.JetBeginSession(JET_INSTANCE instance, JET_SESID& sesid, String username, String password) at Microsoft.Exchange.Transport.Storage.DataConnection..ctor(JET_INSTANCE instance, IDataSource source)

Cause

This issue occurs because a high number of server-to-server connections can exhaust the session limit too quickly.

Resolution

You resolve this issue in the Exchange Management Shell (EMS). For more information about the EMS, see Connect to Exchange servers using remote PowerShell.

To resolve this issue, follow these steps:

  1. Decrease the MaxInboundConnection limit on the Receive connectors of each Exchange server, as follows.

    Note

    To prevent limiting the number of connections from busy sources, such as email gateways, you might have to increase the MaxInboundConnectionPercentagePerSource parameter from the default value of 2. We recommend that you also closely monitor the incoming mail flow and gradually increase the value, as necessary.

    1. To check the current value of the MaxInboundConnection parameter, run the Get-ReceiveConnector cmdlet:

      Get-ReceiveConnector -Server <Server Name> | Format-Table Identity,MaxInboundConnection -Auto
      

      The default value for this limit is 5,000 concurrent connections.

    2. To set the limit to a value of 1,000 concurrent connections, run the following cmdlets:

      Get-ReceiveConnector -Server <Server Name> | Set-ReceiveConnector -MaxInboundConnection 1000
      
    3. To set each Receive connector limit individually, run the Set-ReceiveConnector cmdlet:

      Set-ReceiveConnector -Identity "<Receive Connector Identity>" -MaxInboundConnection 1000
      
    4. Restart the Transport service.

      Restart-Service MSExchangeTransport
      
  2. Override the server-to-server throttle. To set and refresh the override, run the New-SettingOverride and Get-ExchangeDiagnosticInfo cmdlets in Exchange Management Shell:

    New-SettingOverride -Name "Throttle server to server inbound calls" -Component TransportConfiguration -Section ThrottleServerToServerInboundConnections -Parameters ("Enabled=True") -Reason "Any Text String " 
    
    Get-ExchangeDiagnosticInfo -Process Microsoft.Exchange.Directory.TopologyService -Component VariantConfiguration -Argument Refresh
    
  3. Restart the Transport service.

    Restart-Service MSExchangeTransport