High Availability Guide : Administering and configuring HotStandby : Configuring HotStandby : Setting HotStandby server wait time to help detect broken or unavailable connections
  
Setting HotStandby server wait time to help detect broken or unavailable connections
A HotStandby server uses timeout parameters to control how long it waits before it concludes that an existing connection is broken or a new connection cannot be established.
About this task
The timeout parameters are:
HotStandby.PingTimeout
HotStandby.PingInterval
HotStandby.ConnectTimeout
If a HotStandby server that is in the PRIMARY ACTIVE or SECONDARY ACTIVE state tries to contact the other server and receives no reply within a specified amount of time, it changes to PRIMARY UNCERTAIN, PRIMARY ALONE, or SECONDARY ALONE.
Procedure
To control how long the server waits, you can:
Set the PingTimeout parameter to specify the amount of time that the server must wait before it changes to the PRIMARY UNCERTAIN state.
Set the PingInterval parameter to specify the interval between the “ping” messages the server sends to indicate that it is working correctly.
Set the ConnectTimeout parameter to specify the amount of time that the server must wait when it tries to establish a new connection to the other server (for example, in an ADMIN COMMAND 'hotstandby connect' operation).
PingTimeout and PingInterval parameters [HotStandby]
The optional PingTimeout and PingInterval parameters in the [HotStandby] section control the ping operation.
A ping operation is essentially an “I’m alive” message that is sent by one database server to another. The ping system in the HotStandby setup is a passive heartbeat system. When enabled, both the Primary and Secondary servers send ping messages to each other at regular intervals. For more information, see Heartbeat.
HotStandby.PingTimeout specifies how long a server should wait before concluding that the other server is down or inaccessible. Default is 4000 (4 sec.)
HotStandby.PingInterval specifies the interval, in milliseconds, between two pings. Default is 1000 (1 sec.)
For example, if the PingInterval is 10 seconds, then the servers will send ping messages to each other after every 10 seconds. If PingTimeout is 20 seconds and one server (S1) does not hear from the other (S2) within 20 seconds, then S1 concludes that S2 is down or inaccessible. Server S1 then switches to another state, for example, from PRIMARY ACTIVE to PRIMARY UNCERTAIN.
If the values of the parameters are different, the precedence take values set in Primary during execution of the hsb connect command. The values do not change during switchovers. However, they can be changed dynamically with the ADMIN COMMAND 'parameter' command.
If PingTimeout is set to zero, pinging is disabled.
Ping requires little overhead and a solidDB® server is set up to respond quickly to missing ping messages. You can set the PingInterval value to a fairly short interval, such as a second, or even less.
If it is important that you detect a failover quickly, set the PingTimeout value to a relatively short time. However, shorter values also mean a higher chance for false alarms. If your network has a lot of traffic and thus causes delays before a ping message is received, you might need to set the PingTimeout to a large value to avoid false alarms.
Note Some networking software also has a ping operation, but the HotStandby.PingTimeout and HotStandby.PingInterval parameters apply only to the solidDB® server pings, not general network pings.
ConnectTimeout parameter [HotStandby]
In some network implementations, a connect operation might not respond for an indefinite period of time. One possible reason is that the remote server is a known node but unavailable during the connect attempt. By specifying a connect timeout value, you can set the maximum time in seconds that a HotStandby connect operation waits for a connection to a remote server.
You set the connect timeout value with the HotStandby.ConnectTimeout parameter. The unit is milliseconds. The default is 0, which means no timeout. You can set it to a different value, for example:
[HotStandby]
; Set ConnectTimeout to 20 seconds (20000 milliseconds). ConnectTimeout=20000
The HotStandby.ConnectTimeout parameter is used with the following administration commands:
hotstandby connect
hotstandby switch primary
hotstandby switch secondary
See also
Configuring HotStandby