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 for version control, which is located in the application-tier installation directory.

Note

By default, the application-tier installation directory is Drive:\%Program Files%\Microsoft Visual Studio 2008 Team Foundation Server\Web Services\VersionControl.

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.

In addition to these permissions, you might need to address the following requirements on a computer that is running Windows Server 2008 or Windows Vista:

  • To follow a command-line procedure, you might need to open an elevated Command Prompt by clicking Start, right-clicking Command Prompt, and clicking Run as Administrator.

  • To follow a procedure that requires Internet Explorer, you might need to start it as an administrator by clicking Start, clicking All Programs, right-clicking Internet Explorer, and then clicking Run as administrator.

  • To edit web.config files, you might need to start the text editor as an administrator by clicking Start, clicking All Programs, right-clicking the editor, and then clicking Run as administrator.

  • To access Report Manager, reports, or Web sites for SQL Server Reporting Services, you might need to add these sites to the list of trusted sites in Internet Explorer or start Internet Explorer as an administrator.

For more information, see the Microsoft Web site.

To specify a different cache root folder

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

    You can create the 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, you should make sure that only the service account for the application tier has Read and Write permissions to the cache folder.

  2. Right-click the folder, and click Properties.

    The Properties dialog box for the folder opens.

  3. Click the Security tab, and click Add.

  4. Add the local group TFS_APPTIER_SERVICE_WPG, and click OK.

  5. Select both the Read and Write check boxes, clear all other check boxes, and click OK.

  6. Open Windows Explorer, and browse to Drive:\%Program Files%\Microsoft Visual Studio 2008 Team Foundation Server\Web Services\VersionControl.

  7. Open the Web.config file in a text or XML editor, and locate the <appSettings> section.

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

  9. Change the location of the current cache root folder to the new location as the following example shows:

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

    Note

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

  11. Open a Command Prompt window, type iisreset, and then press ENTER.

  12. Delete the old cache root folder.

    Note

    By default, the cache root folder is located at …\Program Files\Microsoft Visual Studio 2008 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 application-tier server, open Windows Explorer, and browse to Drive:\%Program Files%\Microsoft Visual Studio 2008 Team Foundation Server\Web Services\VersionControl.

  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.

  6. Open a Command Prompt window, type iisreset, and then press ENTER.

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

  1. On the application-tier server, open Windows Explorer, and browse to Drive:\%Program Files%\Microsoft Visual Studio 2008 Team Foundation Server\Web Services\VersionControl.

  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.

  6. Open a Command Prompt window, type iisreset, and then press ENTER.

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 by Using the ProxyStatistics Web Service.

To change the interval for saving performance statistics to a file

  1. On the application-tier server, open Windows Explorer, and browse to Drive:\%Program Files%\Microsoft Visual Studio 2008 Team Foundation Server\Web Services\VersionControl.

  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 one hour. The maximum interval is 24 hours.

    For example, the following line specifies that two hours should pass between when the statistics are saved to a file:

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

  7. Open a Command Prompt window, type iisreset, and then press ENTER.

See Also

Other Resources

Managing Application-Tier Servers for Team Foundation