How to: Change Cache Settings for an Application-Tier Server

As a Team Foundation administrator, you can change the settings for the source control file cache on the Team Foundation application-tier server any time after installation. By default, this cache is enabled on the application-tier server and enhances performance by making it possible to download files from the cache instead of directly from the database.

Note

You can also enable the cache on Team Foundation Server Proxy, if you chose to install it. For more information, see Managing Remote Connections to Team Foundation Server Proxy.

You can change cache settings in the following ways:

  • Specify a different cache root folder.

  • Change the limit at which old files are removed from the cache.

  • Change the amount of cache to free when old files are removed.

  • Change the interval for saving cache performance information to a file.

You can perform these tasks by editing the Web.config file on the application-tier server. This Web.config file is located in the application-tier installation directory.

Note

The default application-tier installation directory is …\Program Files\Microsoft Visual Studio 2005 Team Foundation Server\Web Services\VersionControl.

You can also edit the Web.config file by using IIS Manager. For more information, see the following topics:

Required Permissions

To perform these procedures, you must be a member of the Administrators security group on the Team Foundation application-tier server.

To specify a different cache root folder

  1. On the Team Foundation application-tier server, create a new cache folder.

    You can create the new cache folder in the following locations: on a local disk, in the UNC path, or on a mounted drive.

    Security noteSecurity Note

    The cache folder stores sensitive information that is not encrypted. Therefore, make sure that only the application-tier service account has Read and Write permissions to the cache folder.

  2. Open Windows Explorer and locate the application-tier installation directory.

  3. Open the Web.config file in a text or XML editor.

  4. In Web.config, locate the <appSettings> element.

  5. Locate the <add key="fileCacheRoot"> element.

  6. Update the <add key="fileCacheRoot"> element by changing the current cache root folder location to the new location as follows:

    <add key="fileCacheRoot" value="NewCacheRootFolderLocation" />
    
  7. Save and close the Web.config file.

    Tip

    To maximize performance, copy the files from the old cache folder to the new cache folder.

  8. Delete the old cache root folder.

    Tip

    The default cache root folder is located at …\Program Files\Microsoft Visual Studio 2005 Team Foundation Server\Web Services\VersionControl\Data.

Changing Cache Limits for Removing Files

A maximum limit is set on the amount of storage space that the application-tier can use for caching files. When this limit is reached, old files in the cache are deleted to free some storage space so that the space can be used for caching newly requested files. A cleanup routine removes files based on when they were last accessed. Files that have not been accessed for the longest time are deleted first.

To change the limit at which old files are removed from the cache

  1. On the Team Foundation application-tier server, open Windows Explorer, and locate the application-tier installation directory.

  2. Open the Web.config file in a text or XML editor.

  3. In Web.config, locate the <appSettings> element.

  4. Select one of the following:

    • To specify a percentage of available disk space to fill before removing old files from the cache, locate and update the <add key="CacheLimitPercent"> element.

      For example, the following line specifies that the cache should fill up to 60% capacity of available disk space before removing old files:

      <add key="CacheLimitPercent" value="60" />
      
    • To specify a fixed size in MB for the cache to reach before removing old files, locate and update the <add key="CacheLimit"> element.

      For example, the following line specifies that the cache should reach 500 MB before removing old files:

      <add key="CacheLimit" value="500" />
      

      Note

      Both the "CacheLimitPercent" and "CacheLimit" elements cannot be in effect at the same time. To disable either element, omit the value for that element.

  5. Save and close the Web.config file.

To change the amount of cache to free when removing old files

  1. On the Team Foundation application-tier server, open Windows Explorer, and locate the application-tier installation directory.

  2. Open the Web.config file in a text or XML editor.

  3. Locate the <add key="CacheDeletionPercent"> element.

  4. Update the <add key="CacheDeletionPercent"> element by changing the percentage of cache space to free when removing old files.

    For example, the following line specifies to free 50% of the cache when removing old files:

    <add key="CacheDeletionPercent" value="50" />
    
  5. Save and close the Web.config file.

Changing the Interval for Saving Cache Performance Statistics

You can change the interval for saving cache performance statistics to an XML file named ProxyStatistics.xml. These statistics are tracked by performance counters that are installed by default. The ProxyStatistics.xml file is located in the App_Data folder in the application-tier installation directory.

You can view these performance statistics from the Performance monitor or by using the ProxyStatistics Web service. For more information, see How to: Examine Cache Performance for an Application-Tier Server.

To change the interval for saving performance statistics to a file

  1. On the Team Foundation application-tier server, open Windows Explorer, and locate the application-tier installation directory.

  2. Open the Web.config file in a text or XML editor.

  3. In Web.config, locate the <appSettings> element.

  4. Locate the <add key="StatisticsPersistTime"> element.

  5. Update the <add key="StatisticsPersistTime"> element by changing the number of hours for each interval.

    Note

    The default and minimum interval is 1 hour. The maximum interval is 24 hours.

    For example, the following line specifies that 2 hours should pass between saving the statistics to a file:

    <add key="StatisticsPersistTime" value="2" />
    
  6. Save and close the Web.config file.

See Also

Concepts

Managing Team Foundation Server Application-Tier Servers