Export (0) Print
Expand All

Change the Session-Timeout Period for an Availability Replica (SQL Server)

This topic describes how to configure the session-timeout period of an AlwaysOn availability replica by using SQL Server Management Studio, Transact-SQL, or PowerShell in SQL Server 2014. The session-timeout period is a replica property that controls how many seconds (in seconds) that an availability replica waits for a ping response from a connected replica before considering the connection to have failed. By default, a replica waits 10 seconds for a ping response. This replica property applies only the connection between a given secondary replica and the primary replica of the availability group. For more information about the session-timeout period, see Overview of AlwaysOn Availability Groups (SQL Server).

Prerequisites

  • You must be connected to the server instance that hosts the primary replica.

Recommendations

We recommend that you keep the time-out period at 10 seconds or greater. Setting the value to less than 10 seconds creates the possibility of a heavily loaded system missing PINGs and declaring a false failure.

Security

Permissions

Requires ALTER AVAILABILITY GROUP permission on the availability group, CONTROL AVAILABILITY GROUP permission, ALTER ANY AVAILABILITY GROUP permission, or CONTROL SERVER permission.

Arrow icon used with Back to Top link [Top]

To change the session-timeout period for an availability replica

  1. In Object Explorer, connect to the server instance that hosts the primary replica, and expand the server tree.

  2. Expand the AlwaysOn High Availability node and the Availability Groups node.

  3. Click the availability group whose availability replica you want to configure.

  4. Right-click the replica to be configured, and click Properties.

  5. In the Availability Replica Properties dialog box, use the Session timeout (seconds) field to change the number of seconds for the session-timeout period on this replica.

Arrow icon used with Back to Top link [Top]

To change the session-timeout period for an availability replica

  1. Connect to the server instance that hosts the primary replica.

  2. Use the ALTER AVAILABILITY GROUP statement, as follows:

    ALTER AVAILABILITY GROUP group_name

       MODIFY REPLICA ON 'instance_name' WITH ( SESSION_TIMEOUT = seconds )

    where group_name is the name of the availability group, instance_name is the name of the server instance that hosts the availability replica to be modified, and seconds specifies the minimum number of seconds that the replica must wait before applying log to databases when acting as a secondary replica. The default is 0 seconds, which indicates that there is no apply delay.

    The following example, entered on the primary replica of the AccountsAG availability group, changes the session-timeout value to 15 seconds for the replica located on the INSTANCE09 server instance.

    ALTER AVAILABILITY GROUP AccountsAG 
       MODIFY REPLICA ON 'INSTANCE09' WITH (SESSION_TIMEOUT = 15);
    

Arrow icon used with Back to Top link [Top]

To change the session-timeout period for an availability replica

  1. Change directory (cd) to the server instance that hosts the primary replica.

  2. Use the Set-SqlAvailabilityReplica cmdlet with the SessionTimeout parameter to change the number of seconds for the session-timeout period on a specified availability replica.

    For example, the following command sets the session-timeout period to 15 seconds.

    Set-SqlAvailabilityReplica –SessionTimeout 15 ` 
    -Path SQLSERVER:\Sql\PrimaryServer\InstanceName\AvailabilityGroups\MyAg\AvailabilityReplicas\MyReplica
    
    NoteNote

    To view the syntax of a cmdlet, use the Get-Help cmdlet in the SQL Server PowerShell environment. For more information, see Get Help SQL Server PowerShell.

To set up and use the SQL Server PowerShell provider

Arrow icon used with Back to Top link [Top]

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft