Setting up Dynamicweb for Load Balancing with Microsoft ARR for IIS8

In this how-to, we will be setting up Dynamicweb for Load Balancing with Microsoft ARR for IIS8.

We will be setting up Dynamicweb in a 2 server load balanced setup with a third server distributing traffic.

These are the requirements for setting up Dynamicweb in NLB:

  • Application Request Routing (ARR) server

    • Round Robin in a “Shared network content infrastructure”

  • Two or more Windows webservers

    • Running Windows 2012 and IIS 8+

  • MS SQL Server 2012+

    • Optionally in SQL Cluster

  • Shared file server or disc mount

    • Optionally using CDN for static resources

Disks

In the figure below the setup is defined. This setup assumes that all instances of the webservers are mounted to the same disk instance. This means that anything being uploaded on one server is also available in the other servers since it is the same disk.

When the NLB feature has been enabled in the backend of Dynamicweb, logfiles and other file operations will take this into consideration so Dynamicweb instances will not write to the same file from more webserver nodes.

Using disk syncronisation

It is also possible to setup the NLB using syncronised disks, eventhough it can be a bit more complicated.

Folders that should not be synced

  • /Files/Cache.net
  • /Files/System/Diagnostics
  • /Files/System/Log
  • /Files/System/Indexes
  • /Files/System/Integration

All of these folders contains data that are server specific.

Running services

One major thing to take into account when setting up an NLB is the scheduled management of data

  • Integration jobs should only be run in one of the machines in the cluster.
  • Scheduler service should only be run in one of the machines.
  • Indexing
    • When sharing the same disc mount, only on node should have the indexing running
    • When using different discs for each node, each node should have the indexing running 

Create the following host headers (names are just examples):

  • Node1.mysite.com pointing to DW Server 1
  • Node2.mysite.com pointing to DW Server 2
  • Mysite.com pointing to ARR Server

Set up Dynamicweb with a local application folder and a /Files vdir pointing to a local Files folder. Point globalsettings.aspx to an SQL database running on the local server.

Attach the Node1.mysite.com and Mysite.com host headers.

Set up Dynamicweb with a local application folder but point the /Files vdir to the DW Server 1 Files folder using a UNC path.

In the Edit Virtual Directory, click Connect as and select a domain user with Full Control permissions on DW Server 1 (Figure 7.1).

Attach the Node2.mysite.com and Mysite.com hostheaders

Figure 7.1 Editing the virtual directory

Install the IIS8 ARR extension by going to http://www.microsoft.com/web/gallery/install.aspx?appid=ARRv3_0

Create a Server Farm under the Server Farms node and add DW Server 1 and 2 as member servers (Figure 8.1).

Figure 8.1 Creaing a server farm

In the Load Balance window select distribution algorithm. The algorithms “Least current request” and “Least response time” can be used for Dynamicweb usage, but “Weighted round robin” is the recommended method as it allows you to adjust the relative weight of server thus accounting for differences in load or hardware.

In our example setup shown below (Figure 8.2) we use a 55/45 distribution as the 45 server is also used as SQL Server.

Figure 8.2 Example configuration

In the Server Affinity window (Figure 8.3) it is important to select Client Affinity. Host Name Affinity will not work with Dynamicweb.

To complete setup add the mysite.com host header to the ARR Servers default website.

Figure 8.3 The server affinity window

Locate the Load Balancing node in the Management Center and fill in Server names and host header

Figure 9.1 Load Balancing node in DW backend