Technical Tip: Interval between HA heartbeats
Description
This article describes how by default, the time between HA heartbeat packets is 200 milliseconds.
Â
Scope
Â
FortiGate.
Â
Solution
In FortiOS, it is possible to change this time using the following CLI command:
Â
config system ha
  set hb-interval <integer>
  set hb-interval-in-milliseconds {100 | 10}
  set hb-lost-threshold <integer>
end
A heartbeat interval of 2 means the time between heartbeat packets is 200 ms (hb-interval x hb-interval-in-milliseconds (default is 100)).
Changing the heartbeat interval to 5 changes the time between heartbeat packets to 500 ms.
The hb-lost-threshold setting determines the number of consecutive heartbeat packets that must be missed before FortiGate detects a failure. The heartbeat interval and hb-lost-threshold setting together determine the time required to detect a failed HA peer.
HA, heartbeat packets consume more bandwidth if the heartbeat interval is short.
However, if the heartbeat interval is very long, the cluster is not as sensitive to topology and other network changes.
The following debug commands can be used to capture HA communication, executed from the management VDOM :
diagnose debug application hatalk -1
diagnose debug application hasync -1
diagnose debug console timestamp enable
diagnose debug enable
Â
To disable debug:
Â
diagnose debug disable
diagnose debug resetÂ
The heartbeat can also be captured on the interface, executed from the management VDOM:
Â
diagnose sniffer packet any "ether proto 0x8890" 4 0 lÂ
Note:Â If HA devices are in distant locations, consider using a higher timer to avoid false failover due to latency.
Additional note: Increasing HA heartbeat timers could be used as a method to reduce false failovers caused by network jitter, high latency, or packet drops in AWS cloud environments. However, it has to be noted that cloud route updates, VPN negotiation, and application reconnection may take additional time.
Related article:
Troubleshooting Tip: How to troubleshoot HA 'Heartbeat packet lost' issues in a FortiGate HA Cluster
