Microsoft Exchange Transport service stops and returns Event ID 17018

Symptoms

On a server that's running Microsoft Exchange Server and 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

Note

This fix applies to only Microsoft Exchange Server 2019.

To fix this issue, follow these steps:

  1. Install the following security update:

    Description of the security update for Microsoft Exchange Server 2019, 2016, and 2013: February 14, 2023 (KB5023038)

  2. 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
      

      Note: 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.

  3. 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
    
  4. Restart the Transport service.