SQL Server MultiSubnetFailover – Performance Gain for Single Subnet

availability-groupssql serversql-server-2017

On BOL I read following about MultiSubnetFailover=True:

The MultiSubnetFailover connection option should be set to True even if the availability group only spans a single subnet. This allows you to preconfigure new clients to support future spanning of subnets without any need for future client connection string changes and also optimizes failover performance for single subnet failovers.

As I understand the working of MultiSubnetFailover, with this option set the client driver sets up a socket for each IP address associated with the listener. They are all checked in parallel to speed up the process to find the online IP and the first one that response will be the one used for the connection. Here I see a performance gain.

But where is the performance gain in a single subnet? There is only IP associated with the listener.

Best Answer

When MultiSubnetFailover=True is set, SQL Server Native Client will aggressively retry the TCP connection.

So in

  • a multi-subnet scenario, it will attempt connections in parallel, which you already know.

  • a single subnet scenario, it will aggressively retry the TCP connection faster than the OS default TCP retransmit interval, so your reconnect time after an AG failover will be improved.