Configure Shared Hosting Using ARR
Applies To: Windows 7, Windows Server 2008, Windows Server 2008 R2, Windows Vista
This topic describes how to enable the host name affinity feature in Application Request Routing (ARR) to use in your shared hosting environment. The host name affinity feature lets ARR affinitize requests, regardless of whether they were made from one client or multiple clients to one server behind ARR. This guarantees that a given site can consume resources from only one server. A shared hosting deployment with ARR also gives you only one shared configuration to manage, evenly distributes your server resources, and dynamically load balances requests.
You must have IIS 7 installed on a computer that is running Windows Server® 2008 or newer, ARR and its dependent modules, a minimum of two application servers that have working sites and applications, and the servers configured to use a shared configuration and shared content before you continue. You also must have a server farm defined and configured. For more information, see Define and Configure an ARR Server Farm.
To use the host name affinity feature in your shared hosting environment, you must follow these steps:
Enable the host name affinity feature.
Specify the number of servers to use per host name.
Enable Host Name Affinity
Ensure that your application servers are configured to use a shared configuration and shared content. The sites on your application servers should use host name binding. You can enable the host name affinity feature by using the UI or by using the command line.
To enable host name affinity by using the UI
Open IIS Manager.
Expand the server node and then expand the Server Farms node. Select your server farm.
In the Server Farm pane, double-click Server Affinity.
On the Server Affinity page, do the following:
Select Use host name.
Select a provider from the Host name affinity provider list: Microsoft.Web.Arr.HostNameRoundRobin or Microsoft.Web.Arr.HostNameMemory.
The provider determines to which server the host name should be affinitized. HostNameRoundRobin will evenly distribute the number of affinitized host names. HostNameMemory will distribute the number of affinitized host names based on the amount of memory available on the application servers.
Enter a value in the Time-out (minutes) box. By default, this value is set to 20 minutes. The time-out value determines how long the server should wait after the last request with the same host name before resetting.
In the Actions pane, click Apply.
To enable host name affinity by using the command line
Open a command prompt with administrator user rights, and navigate to %windir%\system32\inetsrv.
To enable the host name affinity feature, enter the following command:
appcmd.exe set config –section:webFarms /[name=’serverFarmName’].applicationRequestRouting.affinity.useHostName:”True” /commit:apphost
where serverFarmName is the name of the server farm where you want to enable the host name affinity feature.
Specify Servers Per Host Name
By default, all host names use one application server. You can increase capacity by specifying the number of application servers that sites can use per host name. You can specify the number of servers per host name by using the UI or by using the command line.
To specify the number of servers per host name by using the UI
Open IIS Manager.
Expand the server node and then expand the Server Farms node. Select your server farm.
In the Server Farm pane, double-click Server Affinity.
On the Server Affinity page, click Advanced Settings.
In the Advanced Settings dialog box, do the following:
In the Host Name column, enter a host name. This field is required.
In the Number of Allocated Servers column, enter the number of servers that this host name can use.
In the Alternate Host Names column, optionally specify additional host names that should be treated just like the values in the Host Name column.
Click OK.
To specify the number of servers per host name by using the command line
Open a command prompt with administrator user rights, and navigate to %windir%\system32\inetsrv.
To specify the number of servers per host name, enter the following command:
appcmd.exe set config -section:webFarms /+"[name='serverFarmName'].applicationRequestRouting.affinity.[name='URL',servers='#']" /commit:apphost
where serverFarmName is the name of the server farm where you want to set the number of servers per host name, URL is the host name, and # is the number of servers that you want to allow for that host name. For example, to specify three servers for the host name www.contoso.com, enter the following command:
appcmd.exe set config –section:webFarms /+”[name=’myServerFarm’].applicationRequestRouting.affinity.[name=’www.contoso.com’,servers=’3’]” /commit:apphost
See Also
Concepts
Overview of Shared Hosting Deployment Using ARR
ARR Tasks for Shared Hosters
ARR Common Tasks