Splitting Workload Using Cluster Network
Logging large number of tags at a time can increase the workload of the database. The increase of workload also increases the time required by the database to log all values at a time.
In order to reduce the workload, the Cluster Network will be used to split the task. Below is the system architecture for this application.
An article on setting up a Cluster Network can also be found here.
- First, create a copy of the project folder. In this case, the project folder is called “Load_splitting“.
- Rename the original folder as “Load_splitting_node” and rename the duplicated folder as “Load_splitting_master“. This is to differentiate between master and node.
Part 1: Configuring the Cluster Node
- Firstly, open Load_splitting_node project in Project Editor.
- Secondly, under General task, change the Project ID so that both projects have different Project ID. In this case, the Project ID is changed to “Load_splitting_node“.
- Next, navigate to the IO list and remove any database under the Log column. Make sure that the Log column is cleared. We do not want the cluster node to do the logging.
- Then, navigate to Cluster Network and enable it by selecting True.
- Provide a username and password.
- Next, expand the Cluster Network task and select Remote Master.
- Provide the IP address of the master. In this case, it will be “localhost“. Provide the username and password created earlier. This login credentials will be used to connect to the master.
- Save project.
Part 2: Configuring the Cluster Master
- Firstly, open Load_splitting_master project in Project Editor.
- Secondly, under General task, change the Project ID so that both projects have different Project ID. In this case, the Project ID is changed to “Load_splitting_master“.
- Next, navigate to the IO list. Right-click on any tag and choose Select All (Ctrl+A).
- Then right-click again on any tag and choose Cut (Ctrl+X).
- Next, navigate to Virtual. Paste the tags that was cut previously from IO list under Virtual.
- Next, navigate to Cluster Network and enable it by selecting True.
- Provide the same username and password as the Cluster Node.
- Save project.
Ensure that both Master and Node is pointing to the same database. This is to ensure that the Master will be able to do trending by fetching the data from the same database.
Ensure that only the Master is doing the data logging.
Ensure that both Master and Node have different Project ID.
Only data of identical tags between the master and node will be sync to the master.