2

What is the difference between Session Timeout and Heartbeat in always on... My Network is laggy and i get frequent connection timeout error on error logs and also at the I see missed heartbeat errors on the failover cluster errors ....Which settings should I change. Crossing which thresholds forces a failover---Session timeout or heartbeat ?

Will appreciate any help. Thanks

1

Heartbeat is what will determine if a node is down and initiate a failover. Session timeout could be from the client, server to server, or other network related issues. it seems like you are having several network issues.

You don't have to have a dedicated heartbeat network but if you don't, it does expose you to broadcast storms and other issues that might hit your main network.

AlwaysOn runs on and uses the WSFC APIs but if you have a bad laggy network, it's best to resolve that or at least put your servers on separate network hardware/VLAN/subnet/etc than the clients if that is what is needed to resolve this. Regardless, you will want to ensure a healthy heartbeat at a minimum.

WSFC Inter-node Health Detection and Quorum Voting

Each node in a WSFC cluster participates in periodic heartbeat communication to share the node's health status with the other nodes. Unresponsive nodes are considered to be in a failed state. A quorum node set is a majority of the voting nodes and witnesses in the WSFC cluster. The overall health and status of a WSFC cluster is determined by a periodic quorum vote. The presence of a quorum means that the cluster is healthy and able to provide node-level fault tolerance. +

If you need a quicker bandaid or perhaps you just have to deal with the latency/network issues you can change the value of the timeout to something that works better for your environment.

Run command prompt as administrator. Execute the following to change the same-site heart beat to 2 seconds (replace clustername with the actual WFC name).

cluster /cluster:clustername /prop SameSubnetDelay=2000:DWORD 

Execute the following to change the cross-site heart beat to 4 seconds (replace clustername with the actual WFC name).

cluster /cluster:clustername /prop CrossSubnetDelay=4000:DWORD 

Execute the following to change the same-site ping loss threshold to 10 lost pings (replace clustername with the actual WFC name).

cluster /cluster:clustername /prop SameSubnetThreshold=10:DWORD

Execute the following to change the cross-site ping loss threshold to 10 lost pings (replace clustername with the actual WFC name).

cluster /cluster:clustername /prop CrossSubnetThreshold=10:DWORD 

With Powershell:

Run PowerShell as administrator. Import the FailoverClusters module.

Import-Module FailoverClusters 

Execute the following to change the same-site heart beat to 2 seconds (replace clustername with the actual WFC name). (get-cluster).SameSubnetDelay = 2000 Execute the following to change the cross-site heart beat to 4 seconds (replace clustername with the actual WFC name).

(get-cluster).CrossSubnetDelay = 4000

Execute the following to change the same-site ping loss threshold to 10 lost pings (replace clustername with the actual WFC name).

(get-cluster).SameSubnetThreshold = 10

Execute the following to change the cross-site ping loss threshold to 10 lost pings (replace clustername with the actual WFC name). (get-cluster).CrossSubnetThreshold = 10

Note in no way is this a recommendation to run this on your production systems without first testing it and getting the wider group such as network and server admins involved

  • 1
    So to be short if the heartbeat thresholds are crossed then automatic failover will be initiated but if the session timeouts are crossed then it will only show errors but not failover .... – SqlNovice Oct 27 '17 at 18:25
  • Correct but to be more accurate, if the heartbeat fails x number of attempts (I think it's 5 but I could be wrong on this) then the quorum voting process begins. The failure threshold can be configured to a different number based on your environment. The Quorum then will choose the best course of action which almost always begins a failover process. This – Ali Razeghi Oct 27 '17 at 18:38
  • Added some more info to get you a bandaid for the time being or a different course of action if you need it. Good luck. – Ali Razeghi Oct 27 '17 at 19:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.