Multi-Server Connection Poll Requests
In a multi-server architecture, which includes a Main server and one or more Standby servers, each server polls the other servers to check that the servers can respond to each other. This is achieved by each server sending a series of poll requests to the other servers.
You can use the Server Configuration Tool’s System Configuration>Partners settings to access and define the Monitor setting for a server. The Monitor setting shown on the Standby tab allow you to define how the poll requests between the servers should operate, (see Define the Monitor Timeout Settings for a Server).
The remainder of this section explains how ClearSCADA uses poll requests to determine whether links are idle and therefore need to be closed.
When a server receives a poll request, it replies by sending a response that indicates its status. This allows the servers to check that they can send communications to, and receive communications from, each server in the architecture. During normal conditions, the servers will:
- Send poll requests to the other servers
- Receive poll requests from the other servers
- Respond to poll requests by sending a status response.
When a server first starts, it establishes links to every other server in the architecture. Once a link has been established, the server then sends a poll request to the other servers. In normal circumstances, the other servers will respond by sending a status response in return (via the same link). The other servers will also detect that there is a new server in the architecture and will establish their own links to the server, and send poll requests.
In addition to the connection poll requests, each server use a 'heartbeat poll', which uses its own channel to communicate with the other servers. The heartbeat poll allows a server to identify whether one or more servers have become disconnected very quickly. Each server has 2 ‘heartbeat poll’ links with every other server. For example, in a two-server architecture, Server A has two links to Server B:
- The link that was established by Server A, which is the link that Server A uses to send heartbeat poll requests to Server B. This link is also used by Server B to reply to the heartbeat poll requests from Server A.
- The link that was established by Server B, which is the link that Server B uses to send heartbeat poll requests to Server A. This link is also used by Server A to reply to the heartbeat poll requests from Server B.
Each server sends a heartbeat poll request at preset intervals (milliseconds or seconds). When a server receives a heartbeat poll request, it usually replies with a status response almost instantly, via the same link on which it received the request.
Once a heartbeat poll link has been established, it remains open unless no heartbeat poll requests are sent via the link for a defined time period. This time period is called the Heartbeat Timeout. If no heartbeat poll requests have been received via a link within the Heartbeat Timeout time, the recipient server (the server that is to respond to the expected poll requests) closes the link. This means that resources are not wasted on maintaining inactive links.
Example:
Server A and Server B are configured as part of a Hot-Standby Pair architecture. Server A is Main and Server B is Standby. Both servers are configured to have the default Heartbeat Timeout setting of 30000 milliseconds.
The two servers are started. The Main server establishes a link with the Standby server and sends a heartbeat poll request via the link. The Standby server receives the heartbeat poll request and replies with a status response via the same link.
The Standby server also establishes a link to the Main server and sends a heartbeat poll request via the link. The Main server receives the heartbeat poll request and replies with a status response via the same link.
The Standby server suffers from a power supply problem and goes offline. It can no longer communicate with the Main server.
The Main server, unaware of the problem, sends a heartbeat poll request to the Standby server. The Standby server does not respond. The Main server will continue to send heartbeat poll requests every 30000 milliseconds, until the Request Timeout is reached (the Request Timeout defined in the Transfer section of the Main server’s Partners settings, see Define the Transfer Interval and Transfer Timeouts). If the Main server has not received a response from the Standby server before the Request Timeout is reached, the Main server closes the link.
The Main server is also expecting to receive heartbeat poll requests via the other link (the link that was initiated by the Standby server). As the Standby server is offline, it is no longer sending heartbeat poll requests.
The Main server waits for the defined Heartbeat Timeout of 30000 milliseconds. If the Standby server has not sent a heartbeat poll request via the link within the 30000 millisecond timeout period, the Main server closes the link.