How to Setup ARR on IIS

Application Request routing on iis ARR Server Farm

Setting Up Application Request Routing (ARR) on IIS: A Comprehensive Guide

Application Request Routing (ARR) is a powerful extension for Internet Information Services (IIS) that significantly enhances web server capabilities. By providing load balancing, SSL offloading, and URL-based routing, ARR enables you to build scalable and highly available web applications. This guide provides a detailed, step-by-step walkthrough of setting up ARR on IIS, complete with explanations, configuration options, and troubleshooting tips.

1. Installing ARR and Dependent Modules

ARR requires specific IIS roles and features. The most efficient way to install everything is using PowerShell (run as administrator):

Install-WindowsFeature Web-Server, Web-Common-Http, Web-Default-Doc, Web-Http-Errors, Web-Static-Content, Web-Http-Redirect, Web-Health, Web-Performance, Web-WebSockets, Web-App-Init, Web-Client-Auth, Web-Cert-Auth, Web-Filtering, Web-Stat-Compression, Web-Dyn-Compression, Web-Mgmt-Tools, Web-Mgmt-Console, Application-Request-Routing

This single command installs the Web Server role, necessary features, management tools, and Application Request Routing. After installation, restart IIS or the server. You can verify the installation in IIS Manager under “Server Farms.”

2. Creating and Configuring Server Farms

A server farm is a group of servers that ARR distributes traffic to.

Steps in IIS Manager:

  1. Open IIS Manager.
  2. Right-click “Server Farms” and select “Create Server Farm…”.
  3. Give your server farm a descriptive name (e.g., “WebFarm1”).
  4. Add the server addresses (e.g., 192.168.1.2, 192.168.1.3) of your backend servers. You can add servers by IP address or hostname.
  5. Click “Finish.”

Key Server Farm Settings (Configurable after creation):

Setting Description Options/Considerations
Load balancing Determines how requests are distributed among servers.
  • Round Robin: Distributes requests sequentially.
  • Weighted Round Robin: Distributes requests based on assigned weights.
  • Least Requests: Sends requests to the server with the fewest active connections.
  • Least Response Time: Sends requests to the server with the lowest average response time.
  • URL Hash: Distributes requests based on a hash of the URL. Useful for session affinity (sticky sessions).
  • Custom Load Balancer: Allows integration with custom load balancing logic.
Health Checks Monitors the health of backend servers.
  • HTTP/HTTPS: Checks for a specific HTTP status code (e.g., 200 OK). Highly recommended.
  • TCP: Checks for a successful TCP connection.
  • Configure intervals, timeouts, and successful response codes.
Server Affinity Maintains client sessions with the same server (sticky sessions).
  • None: No session affinity.
  • Client IP Address: Uses the client’s IP address to determine the server.
  • Host Name: Uses the host name to determine the server.
  • Cookie: Uses a cookie to maintain session affinity. The most reliable method.
Caching Configures caching of responses from backend servers.
  • Enable caching to improve performance for frequently accessed content.
  • Configure cache duration and storage.

3. Configuring URL Rewrite for ARR

URL Rewrite is essential for directing traffic to the server farm and implementing URL-based routing.

Steps in IIS Manager:

  1. Select the website where you want to implement ARR.
  2. Open “URL Rewrite.”
  3. Click “Add Rule(s)…” in the “Actions” pane.
  4. Choose “Reverse Proxy” and click “OK.”
  5. In the “Inbound rules” section, enter the server farm name.
  6. Check “Enable SSL Offloading” if applicable.
  7. Click “OK.”

Example URL Rewrite Rule (web.config):

<rewrite>
  <rules>
    <rule name="ReverseProxyInboundRule1" stopProcessing="true">
      <match url="(.*)" />
      <action type="Rewrite" url="http://WebFarm1/{R:1}" />
    </rule>
  </rules>
</rewrite>

This rule forwards all requests to the “WebFarm1” server farm.

4. SSL Offloading

SSL offloading decrypts SSL traffic at the ARR server, reducing the load on backend servers. This is especially beneficial for CPU-intensive SSL operations.

Configuration:

  1. In IIS Manager, select your server farm.
  2. Open “SSL Settings.”
  3. Check “Enable SSL Offloading.”
  4. Ensure you have a valid SSL certificate bound to the website.

5. Monitoring and Logging

ARR provides detailed logging and monitoring capabilities.

Key Metrics to Monitor (using Performance Monitor):

  • Requests per Second: Measures the rate of incoming requests.
  • Current Connections: Shows the number of active connections to the server farm.
  • Bytes Total/sec: Tracks the amount of data transferred.
  • Failed Requests: Indicates the number of failed requests.
  • Average Response Time: Measures the average time taken to process requests.

Logging:

ARR logs are located in %SystemDrive%\inetpub\logs\LogFiles. Enable detailed logging for troubleshooting.

6. Advanced Configuration and Troubleshooting

  • ARR Cache: Configure caching to further improve performance.
  • Client Certificate Mapping: Map client certificates to backend servers for authentication.
  • Troubleshooting 502 Errors: Check backend server availability, network connectivity, and application pool health.
  • Troubleshooting 503 Errors: Check server farm health, application pool availability and queue length.

Conclusion

By following these steps, you can effectively set up and configure ARR on IIS to enhance the performance, scalability, and availability of your web applications. Remember to regularly monitor performance and adjust settings as needed.


©2025 ServerTools.site
Please disable your adblocker or whitelist this site!