HTML5 WebHMI Redundancy and Network Load Balancing
You can make HTML5/MobileHMI pages redundant with the use of Application Request Routing (ARR). This is a Windows feature, so the steps may change for different versions of Windows or as Windows is updated. Please consult Microsoft documentation for the most accurate steps.
Prerequisites
-
IIS (Internet Information Services) 8.0 or above on Windows Server 2012 or newer
-
Microsoft Application Request Routing and dependent modules (download for (x64) available here)
-
Minimum of two Redundant GENESIS64 servers with working WebHMI
To create a server farm in Application Request Routing:
-
Launch IIS Manager.
Application Request Routing is a server level feature. Select and expand the root of the server.
Server Farm in Application Request Routing: -
Right-click Server Farms, and then select Create Server Farm....
-
Enter a name for the server farm. Click Next.
-
Add servers to the server farm. On the Add Server page of the wizard, add as many application servers as needed.
Add Server
Click Finish to create the server farm with the entered application servers as the server farm members. Confirm the creation of URL rewrite rule.
Rewrite Rules
-
Select the server farm you have created. The following icons are shown:
Server Farm Ribbon
Here you can configure some additional preferences:
To change the load balance algorithm:
If you wish to change the default settings, double-click Load Balance and select the preferred Load balance algorithm and Load Distribution system.
Load Balance
To verify URL rewrite rules:
If you have created the server farm using the steps outlined above, the URL rewrite rules have already been created for a simple load balancing scenario.
-
Double-click Routing Rules.
-
Verify that the Use URL Rewrite to inspect incoming requests checkbox is selected.
Routing Rules
-
SSL offloading is enabled by default. When this feature is enabled, all communication between the ARR server and the application servers are done in clear text, even for HTTPS requests from clients to the ARR server. When both the ARR server and the application servers are deployed within a trusted network, such as within the same datacenter, enabling SSL offloading does not sacrifice security. Also, enabling this feature can further help to maximize the server resources on the application servers, since they do not have to spend cycles in encrypting and decrypting requests and responses.
To disable SSL offloading, uncheck the Enable SSL offloading checkbox, and then click Apply. -
Open a browser and send several requests to the ARR server.
-
To verify that the requests are being load balanced equally between the application servers, select myServerFarm. Double-click Monitoring and Management.
-
In the dashboard view, verify that the requests are being evenly distributed.
To configure health check monitoring:
Application Request Routing monitors the health of the content servers in two ways:
-
Via the live traffic
-
Via an explicit URL testing
The live traffic testing is performed automatically by default when the requests are made to Application Request Routing. The explicit URL testing is an additional test that can be used with the live traffic testing:
-
In IIS Manager, select the server farm and double-click Health Test.
Health Test
-
Enter http://(server name or FQDN of ARR server)/anyglass/account/status as the URL value.
-
Enter 200 as the Response match value. Response match is an optional test to make sure that the body of the response contains the expected string. Click Apply to save the changes.
-
To verify the functionality of health check monitoring, stop the monitored site on one of the application servers. Since the Interval (seconds) value is set to 30 seconds, wait for 30 seconds for the next health check.
-
After waiting for 30 seconds, send several requests to the ARR server.
-
To verify that all requests are going to the healthy server(s), double-click Monitoring and Management, and then refresh the dashboard by using the F5 key. Note that the runtime statistics have been reset. This is by design. You may want to send additional requests and refresh the dashboard as needed.
Monitoring and Management
-
Health monitoring is also used to detect when an unhealthy server becomes healthy. To verify this functionality, start the site that was stopped in Step 9. Again, since the Interval (seconds) value is set to 30 seconds, wait for 30 seconds for the next health check.
-
After waiting for 30 seconds, send several requests to the ARR server.
-
To verify that the requests are distributed evenly between servers, refresh the dashboard in IIS Manager. Note that the runtime statistics have been reset. This is by design.
To configure client affinity:
Application Request Routing provides a client affinity feature that maps a client to a content server behind Application Request Routing for the duration of a client session. When this feature is enabled, the load balancing algorithm is applied only for the very first request from the client. From that point on, all subsequent requests from the same client would be routed to the same content server for the duration of the client session. Setting the client affinity is necessary for HTML5 clients to work properly.
-
Double-click Server Affinity.
-
To enable client affinity, select the Client affinity checkbox, and then Apply.
Server Affinity
Application Request Routing uses a cookie to enable client affinity. The Cookie name will be used to set the cookie on the client. The client must accept cookies for client affinity to work properly.
-
Send several requests to the ARR server to verify the functionality of client affinity. Refresh the dashboard in IIS Manager (Monitoring and Management). Verify that the runtime statistics are changing for only one of the application servers to where the client is affinitized. You may want to send additional requests and refresh the dashboard as needed.