Applies to:
PcVue version 8.2 onwards. |
||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
Summary:
This article explains how to set up load balancing on a PcVue network. |
||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
Details:
What is Availability Rate The balancing of workload in PcVue applies at these levels:
This mechanism is based on the Availability Rate of a station within an association of servers. The Availability Rate can be set from 0 to 100. Contrary to what one might suppose Availabilty Rate is not a percentage but of a level of priority, 100 for maximum priority and 0 for minimum. Note that 0 does not mean that the server is de-activated in the association – it just has the lowest priority. A station can belong to several associations. It has an Availability Rate within each association and that rate can be adjusted in independently. In an association of two servers, if the first has an Availability Rate of 90 and the other of 10, one can consider that server 1 is the main one and server 2 is secondary. Indeed when the two servers are available, the highest Availability Rate defines the active server. So if only server 2 is started, it is active, whereas if server 1 starts, it will take over data acquisition, forcing server 2 to become passive. However, with dynamic modification of the Availability Rate it is possible to block the switch-over on re-starting of a server. In the case where two servers have the same Availability Rate, it is the lowest station number that takes priority. Changing the Availability Rate value You can obtain the Availability Rate via the properties of a station in the Parameters tab. This setting represents the default value that will be applied to the station in each of its associations. For data acquisition associations, the only way of changing the rate is by using the SCADA Basic instruction: This instruction lets you dynamically change the value of the Availability Rate of a station in an association. The rate is dynamic and is not stored in any file. There is no dialog box for configuring it. Its value is distributed automatically to the set of stations that are connected or connecting, so it is not necessary to apply it on each station manually. The SCADA Basic instruction can also be used for historical associations. It can enable redirection of all recordings to a given server while another server is undergoing maintenance (saving archives, re-indexing etc.). Putting this into operation Workload balancing across two servers Balancing In this configuration it is intended that Server 1 is the main server for data from Device 1 and Device 2, whilst Server 2 is the standby server for it. In the same way, it is intended that Server 2 is the main server for Device 3 and Device 4, with Server 1 as standby. PcVue configuration In PcVue we declare 2 associations:
Each server is configured accordingly. The variables of Device 1 and Device 2 will be produced by Asso1_2 and the variables of Device 3 and Device 4 will be produced by Asso2_1. Initialization At start-up of PcVue, a SCADA Basic script must be run. Here we define each main server with an Availability Rate of 90 and each standby server with an Availability Rate of 10, as in the following script: LAN (SET_AVAILABLE_RATE, “Asso1_2”, “Server 1”,90); Since this script is only required to be run on the server stations, on whichever server starts first, a check should be applied to prevent it from running otherwise. Balancing of the workload load across multiple servers The following explanation uses three servers for ease of understanding. The principles and mechanisms used are however applicable for associations containing more servers. Balancing The balancing of workload via this configuration is configured as follows:
In this configuration, Server 3 won’t become active for Device 1 and 2 unless Server 1 and Server 2 are unavailable to them. PcVue configuration In PcVue we declare 3 associations:
We apply those rates to each of the three servers. The variables of Device 1 will be produced by Asso1, the variables of Device 2 will be produced by Asso2 and the variables of Device 3 and Device 4 will be produced by Asso3. Initialization When PcVue starts, a SCADA Basic script must be executed. We define a main server with an Availability Rate of 90, a first standby server with an Availability Rate of 50 and a second standby server with an Availability Rate of 10. In this example, we reserve the availability ratios 100 and 0 for cases of manual or programmed switch-over. That leads us to the following script: ‘Initialization of Asso1 LAN (SET_AVAILABLE_RATE, “Asso1”, “Server1”,90); ‘Initialization of Asso2 LAN (SET_AVAILABLE_RATE, “Asso2”, “Server2”,90); ‘Initialization of Asso3 LAN (SET_AVAILABLE_RATE, “Asso3”, “Server3”,90); Since this script is only required to be run on the server stations, on whichever server starts first, a check should be applied to prevent it from running otherwise. Manual or programmed switch-over If a switch-over is required, the SCADA Basic instruction used below no longer applies: LAN (“SET_SERVER_MODE”,Association,Station,Mode) The workload balancing by Availability Rate takes priority. So in the same way as for start-up, it is necessary to use the instruction LAN (“SET_AVAILABLE_RATE”,Association,Station,Rate) to modify the Availability Rate of the stations in the association. In the case of redundancy with two servers, no problem arises as you just need to reverse the rates. In the case of associations containing more than two servers, the method to use is different. To force an active or passive server To force a server temporarily to work as active or passive, you can reserve a high priority (100) and a low priority (0). To force a server to active, run the following SCADA Basic instruction: LAN (“SET_AVAILABLE_RATE”,Association,Station,100); and to force a server to passive: LAN (“SET_AVAILABLE_RATE”,Association,Station,0); To change the workload balancing Changing the load balancing is a more delicate matter. With more than two servers, you must take it through an intermediate stage. Indeed, with the instruction SET_AVAILABLE_RATE distributed across the network to the other stations, a synchronism problem can occur with multiple servers. Let’s take the previous example of three servers in Asso1. The initial balancing is:
Let’s suppose that one wants to change it as follows:
You could run the following SCADA Basic script to change the balancing directly: LAN (SET_AVAILABLE_RATE, “Asso1”, “Server1”,10); However that risks a double switch-over occurring! If one runs the instructions line by line, it’s clear that after the first instruction, Server2 has the highest Availability Rate (50), so it becomes active. With the last instruction, Server3 gains the highest Availability Rate and then becomes active. So there is a first cut-over from Server 1 to Server 2 and a second one from Server 2 to Server 3 instead of a single cut-over from Server 1 to Server 3 directly. To avoid this problem, one can use a different workload balancing script as follows: ‘——-Set a temporary rate for Server3 so that it becomes active |
||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
|
Created on: 02 Sep 2011 Last update: 13 May 2024