Pilot program management using Application Request Routing

Published on June 25, 2008 by pharr

Updated on July 02, 2008 by pharr

Average Rating  Rate It (1)

Tags
ARR
RSS

Overview

This topic leads the reader through the steps to launch and manage pilot or beta program using Application Request Routing.  Application Request Routing can be used to target and route the appropriate users to the pilot site or it can also be used to limit and manage the amount traffic that is routed to the pilot site.  In this walkthrough, we will focus on how Application Request Routing can be used to route specific requests to the pilot site based on users’ profile.

Goal

To configure Application Request Routing to manage and mitigate risks around launching a pilot program. 

Prerequisites

This walkthrough requires the following prerequisites:

  •  IIS 7.0 on Windows 2008 (any SKU).
  • Microsoft URL Rewriter Customer Technical Preview (CTP) 1.
  • Microsoft Application Request Routing CTP1.
  • Minimum 4 content servers with ASP.NET installed.
  • Alternate browser to Microsoft Internet Explorer, such as Firefox, on a computer with .NET 3.5 installed.  (This setup is used only for testing purposes.)

If URL Rewriter CTP1 or Application Request Routing CTP1 has not been installed, it is available for download at:

  • URL Rewriter x86
  • URL Rewriter x64
  • Application Request Routing x86
  • Application Request Routing x64

Another prerequisite is that the reader has defined and configured a server group using the steps outlined in Define and Configure an Application Request Routing (ARR) Server Group.  Before proceeding with this walk through, the server should be configured like the diagram below:

Step 1 – Create a pilot sites (optional)

In this walkthrough, there needs to be two sites, one representing the production site and the other representing the pilot site.  The previously created site, Comic.Net, as shown above, is used as the production site, while a simple “Hello world” page is created as the pilot site.

For this walkthrough, simple sites are created on the same server as where the Application Request Routing is installed.  Optionally, the sites can be created on separate physical servers or skip step 1 entirely and use existing content servers, if you already have them.

To create sites via UI:

1.      Launch IIS Manager (inetmgr).
2.       Create a site by right clicking on Sites, and select Add Web Site…:

3.       Create pilotSite1 on port 9002 as shown below.  Create appropriate Physical path, as needed:

4.       Repeat the steps in 2 and 3 to create pilotSite2 on port 9003.
5.       At the root of the physical paths created in step 3 for pilotSite1 and pilotSite2, create the following default.htm file:

<html>
     <body>
           Hello world!
     </body>
<html>

6.       Verify that both pilotSite1 and pilotSite2 are working by visiting http://localhost:9002/ and http://localhost:9003/, respectively.

Step 2 – Define and configure a server group for pilot site

To create and define a server group via UI:

1.       Launch IIS 7 inetmgr.
2.       Select the root of the server:

Locate Application Request Routing icon under IIS group heading and double click on the icon.

3.       To create a server group, under Actions, click on Create Server Group and name the server group pilotSiteServers:


4.       Select the server group that was created in step 3.
5.       To add servers to the server group, under Actions, under Server Group Management, click on Add Server.  Below example shows adding the two sites created above:

Some load balance algorithms use the weight of the server to proportionally load balance the traffic.  The ones that use the Load Balance Weight are:

  • ·         Weighted Round Robin
  • ·         Weighted Total Traffic

The weights are normalized. So if all servers have the same weight, they will all get the equal amount of traffic.

Auto Start indicates the default server status of corresponding servers in the server group when Application Request Routings starts.  By default, the servers should be considered to be Available.  That is to say that the Auto start checkbox is checked by default.

6.       Click OK to save changes.
7.       To use weighted round robin algorithm, under Actions, under Server Group Management, click on Server Group Settings.  Select Load Balance tab and select Weighted round robin under Algorithm:

After the completion of this step, the server is configured like the following:

Step 3 – Manage pilot program based on users’ profile

If there are any previous rewrite rules in URL Rewrite Module, remove them by selecting the rule and under Actions, click on Remove.

In this step, URL rewrite rules are created so that only the users who have installed .NET 3.5 and are using Microsoft Internet Explorer are routed to the pilot site, defined as pilotSiteServers.  All others are routed to the production site, defined as comicSiteServers.

To create URL rewrite rules via UI:

1.       Launch IIS 7 inetmgr.
2.       Select the root of the server:

Locate URL Rewrite Module icon under IIS group heading and double click on the icon.

3.       Several URL Rewrite Rules have to be written.  First rule is designed to inspect the requests to determine if:

  • The user is using Microsoft Internet Explorer (MSIE)
  • The user’s computer has .NET 3.5 installed (.NET CLR 3.5)

To create an URL Rewrite Rule, under Actions, click on Add Rule… and enter the following values:

  • Name: Pilot users (IE and .NET 3.5)
  • Requested URL: Matches the pattern
  • Using: WildCards
  • Pattern: *
  • Ignore Case: Checked

4.       The HTTP_USER_AGENT HTTP header can be used to determine what browser the user is using.  Click on Add Conditions and click on Add….  Enter the following values:

  • Condition input: {HTTP_USER_AGENT}
  • Check if input string: Matches the pattern
  • Pattern: *MSIE*
  • Ignore case: Checked

Above condition checks to see if the string “MSIE” is contained in the value of {HTTP_USER_AGENT}.

5.       Likewise, the HTTP_USER_AGENT can be used to determine what .NET version is installed.  Click on Add Conditions and click on Add….  Enter the following values:

  • Condition input: {HTTP_USER_AGENT}
  • Check if input string: Matches the pattern
  • Pattern: *.NET CLR 3.5*
  • Ignore case: Checked

Above condition checks to see if the string “.NET CLR 3.5” is contained in the value of {HTTP_USER_AGENT}.

6.       Since the Application Request Routing and the four sample sites are installed and created on the same server, we will have to add a condition so that the URL Rewrite Rule is only applied on the initial requests on port 80.  Click on Add Conditions and click on Add….  Enter the following values:

  • Condition input: {SERVER_PORT}
  • Check if input string: Matches the pattern
  • Pattern: 80
  • Ignore case: Checked

7.       Under Action, enter the following values:

  • Action Type: Rewrite
  • Rewrite ULR: http://pilotSiteServers/{R:1}
  • Append query string: Checked
  • Stop processing of subsequent rules: Checked

Note that the server group alias, pilotSiteServers, is reference in the Rewrite ULR, to indicate that the requests matching this rule will be routed to the servers that belong to pilotSiteServers server group.

Under Actions, click on Apply.  After saving, click on Back to Rules to create more rules.

8.       Another rule is needed to manage all other requests.  Under Actions, click on Add Rule… and enter the following values:

  • Name: Production users
  • Requested URL: Matches the pattern
  • Using: WildCards
  • Pattern: *
  • Ignore Case: Checked

9.       Since the Application Request Routing and the four sample sites are installed and created on the same server, we will have to add a condition so that the URL Rewrite Rule is only applied on the initial requests on port 80.  Click on Add Conditions and click on Add….  Enter the following values:

  • Condition input: {SERVER_PORT}
  • Check if input string: Matches the pattern
  • Pattern: 80
  • Ignore case: Checked

10.   Under Action, enter the following values:

  • Action Type: Rewrite
  • Rewrite ULR: http://comicSiteServers/{R:1}
  • Append query string: Checked

The requests that match this rule will be routed to the production servers that belong to comicSiteServers server group.  Click on Apply under Actions to save the rule.

11.   To test this functionality, launch Microsoft Internet Explorer and send several requests to the default site on port 80.  Also ensure that .NET 3.5 is installed.  Verify that the requests are routed to the “Hello world!” site.   
12.   Likewise, launch a non-Microsoft Internet Explorer, such as Firefox, and send several requests to the default site on port 80.  Verify that the user is directed to the production site, represented as a comic site in this walkthrough.
13.   To confirm that the requests are being load balanced between comicSite1 and comicSite2 in production and pilotSite1 and pilotSite2 in pilot environments, select the root of the server in inetmgr, double click on Application Request Routing icon under IIS heading, and select comicSiteServers  to display the dashboard for the production environment.  The runtime statistics provide the visibility on how the traffic is being routed.  Likewise, select pilotSiteServers to display the dashboard for the pilot environment:

                 You may want to send additional requests and refresh the dashboard, as needed, by hitting F5.

Summary

You have now successfully defined the rules in URL Rewriter and leveraged Application Request Routing to route only a subset of your users to the pilot site.  For additional Application Request Routing properties and capabilities, refer to other Application Request Routing walkthroughs.

Related Content

Comments

You must Log In to comment.

Page view counter