Configure and Enable Disk Cache in Application Request Routing

by IIS Team

This section of the documentation applies to Microsoft Application Request Routing Version 2 for IIS 7 and Above.

Goal

To successfully configure and enable disk cache to be used in core Application Request Routing (ARR) Version 1 scenarios.

Prerequisites

The core ARR Version 1 scenarios must be configured successfully:

This walkthrough focuses on configuring and enabling the disk-based cache for the scenarios above.

If Application Request Routing Version 2 has not been installed, you can download it at:

  • Microsoft Application Request Routing Version 2 for IIS 7 (x86) here (https://download.microsoft.com/download/4/D/F/4DFDA851-515F-474E-BA7A-5802B3C95101/ARRv2_setup_x86.EXE).
  • Microsoft Application Request Routing Version 2 for IIS 7 (x64) here (https://download.microsoft.com/download/3/4/1/3415F3F9-5698-44FE-A072-D4AF09728390/ARRv2_setup_x64.EXE).

Follow the steps outlined in this document to install ARR Version 2.

Step 1 - Configure primary disk cache location(s)

At least one primary disk cache location must be specified.

To configure a primary disk cache location using the UI:

  1. Launch IIS Manager.

  2. The disk cache configuration for ARR is done at the server level. Select the server in the navigation tree view.

    Screenshot of the I I S Manger navigation tree. A R R one Administrator is selected and expanded.

  3. Double-click Application Request Routing Cache.

    Screenshot of the I I S Manger navigation tree. A R R one Administrator is selected and expanded. The Application Request Routing Cache is shown.

  4. In the Actions pane, click Add....

    Screenshot of the Actions pane. The Add button is located under the Drive Management heading.

  5. In the Add Drive dialog box, define the Drive location and set a maximum size. If no size is provided, then it will consume all available disk space.
    Screenshot of the Add Drive dialog box. The Drive location and Limit Maximum size in GB boxes are shown.

    Note

    If the drive location was created manually, ensure that the identity of the worker process has the following user rights. In most cases, the local Users group has the sufficient user rights on the folder when it was created.

    1. Read
    2. List folder contents
    3. Write
  6. Enter the appropriate values, and then click OK to save the changes. For the purposes of this walkthrough, c:\cache\ is used as the drive location and a maximum size of 10GB has been set. You can enter any value up to your maximum drive size or use the entire drive.

    Screenshot of the Application Request Routing Cache. The Drive Location, Maximum Size and Utilization columns are shown.

    Note

    ARR has the concept of a primary drive and a secondary drive. A typical configuration involves one or more primary drives that are local drives, such as e:\cache or f:\cache. However, there can only be one secondary drive and, typically, it is a SAN drive that can be shared between multiple ARRs. The idea is that you have a large SAN drive where more content can be cached than on the local drive of an ARR, and it can also be shared across multiple ARR instances.

Step 2 - Configure secondary disk cache location

The secondary disk cache location is an optional configuration. As noted above, unlike the primary drive, only one secondary drive can be configured. In a way, the secondary disk cache location is used as a "parent cache tier." ARR looks for cached content in the secondary drive when it is unable to find it in the primary cache drive location(s). Similarly, when caching content, ARR will cache it on both the primary cache drive location(s) as well as the secondary cache drive location.

To configure a secondary disk cache location using the UI:

  1. In the Actions pane, click Add Secondary....

    Screenshot of the Actions pane. The Add Secondary box is located under the Drive Management heading.

  2. In the Add Secondary Drive dialog box, define the Drive location.

    Screenshot of the Add Secondary Drive dialog box. The Drive location box is shown.

  3. Enter the appropriate value, and then click OK to save the changes. For the purposes of this walkthrough, \\wonyoo-w2k8-3\SAN\ is used as the secondary cache drive location.

    Screenshot of the Drive Location, Priority, and Health Status columns. For the purposes of this walkthrough, backslash backslash won yoo dash w two k eight dash three backslash S A N backslash is used as the secondary drive location.

Step 3 - Enable disk cache

Once the drive location is specified, ARR proxy can choose to use the configured disk cache. There are two levels of proxies in ARR. One is at the server level and the other is at the server farm level. In both cases, the disk cache is enabled by default. Once the primary cache drive location is configured, ARR will start caching contents on disk by default.

The rest of the walkthrough assumes that the server farm has already been created. If not, follow the Define and Configure an Application Request Routing Server Farm walkthrough.

  1. Select Server Farms.

  2. Select the server farm that you created.

  3. The following icons are shown:

    Screenshot of the Server Farm. The Caching, Health Test, Load Balance, Monitoring and Management, Proxy, Routing Rules, and Server Affinity icons are shown.

  4. Double-click Caching. Verify that the Enable disk cache checkbox is selected.

    Screenshot of the Caching Icon. The Enable disk cache checkbox is checked.

    Note

    Authorization cannot be delegated to ARR. Therefore, if the contents are highly sensitive in nature and require authorization, it is recommended that you do not enable cache.

Step 4 - Verify functionality

By default, the kernel cache by http.sys on Windows limits the size of individual objects to 256KB. To change this setting globally, see https://support.microsoft.com/kb/820129/en-us.

Make a few requests that will get cached in ARR.

To verify that memory caching is working:

  1. Open a command prompt with elevated user rights.

  2. Enter netsh http show cache.

    Screenshot of the Administrator Command Prompt. Net s h h t t p show cache is written.

  3. By default, memory cache duration is 5 seconds.

Step 5 - Verify the cache functionality using IIS Manager

  1. Navigate to Application Request Routing UI at the server level in IIS Manager.
  2. Click on Browse cache content in the actions pane on the right.
  3. Verify that responses are cached on the primary cache drive.
  4. Verify that the contents also exist on the secondary cache drive location.

In addition to verifying the disk cache functionality on the file system, ARR provides a graphical dashboard view of the cache performance.

  1. Select Server Farms.

  2. Select the server farm that you created.

  3. The following icons are shown:

    Screenshot of the Server Farm with the Caching Icon, Health Test Icon, Load Balance Icon, Monitoring and Management Icon, Proxy Icon, and Routing Rules Icon.

  4. Double-click Monitoring and Management. This view provides the server farm-level runtime statistics, including the cache hit/miss ratio as well as how much bandwidth has been saved due to ARR disk cache.

    Screenshot of the Monitoring and Management Icon. The runtime Disk Cache Statistics is shown.

Summary

You have now successfully configured and enabled a disk cache for ARR. For other ARR Version 2 walkthroughs, see the documents in this article.