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

 

To create a server farm in Application Request Routing:

  1. 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:

  2. Right-click Server Farms, and then select Create Server Farm....

  3. Enter a name for the server farm. Click Next.

  4. 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
          

  5. 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.

 

  1. Double-click Routing Rules.

  2. Verify that the Use URL Rewrite to inspect incoming requests checkbox is selected.

              Routing Rules
           

  3. 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.

  4. Open a browser and send several requests to the ARR server.

  5. To verify that the requests are being load balanced equally between the application servers, select myServerFarm. Double-click Monitoring and Management.

  6. 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:

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:

 

  1. In IIS Manager, select the server farm and double-click Health Test.

             Health Test
             

  2. Enter http://(server name or FQDN of ARR server)/anyglass/account/status as the URL value.

  3. 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.

  4. 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.

  5. After waiting for 30 seconds, send several requests to the ARR server.

  6. 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
             

  7. 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.

  8. After waiting for 30 seconds, send several requests to the ARR server.

  9. 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.

 

  1. Double-click Server Affinity.

  2. 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.

  3. 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.