Change cache settings for an application-tier server
Azure DevOps Server 2022 | Azure DevOps Server 2020 | Azure DevOps Server 2019 | TFS 2018
You can help increase or balance performance in your deployment of Azure DevOps Server by changing the settings of the cache for files that are under version control on the application-tier server. By default, this cache is enabled so that users can download files quickly from the cache, rather than directly from the database. As an administrator, you can change the settings of this cache any time.
- Specify a different cache root folder
- Change the limit at which old files are removed from the cache
You can do these tasks by editing the web.config file for version control, which is located in the installation directory on the application-tier server.
Note
By default, the installation directory for the application tier is %programfiles%\Azure DevOps Server 2019\Application Tier\Web Services.
Prerequisites
To perform these procedures, you must be a member of the Administrators security group on the application-tier server for Azure DevOps.
For more information, see User Account Control.
Specify a different cache root folder
On the application-tier server, create a cache folder.
You can create the folder on a local disk, in the UNC path, or on a mounted drive. For example, you might create the following folder:
d:\temp\cacheroot
Important
The cache folder stores sensitive information that is not encrypted. Therefore, you should make sure that only the service account of the application tier (TFSService) has Modify permissions to this folder.
Open the shortcut menu for the folder, and then select Properties.
The Properties dialog box for the folder opens.
On the Security tab, select Edit.
The Permissions dialog box opens.
Select Add.
The Select Users, Computers, or Groups dialog box opens.
Add the local group TFS_APPTIER_SERVICE_WPG, and then select OK.
Select the Modify check box, clear all other check boxes, and then select OK.
In Windows Explorer (or File Explorer), browse to %programfiles%\Azure DevOps Server 2019\Application Tier\Web Services.
Open the web.config file in a text or XML editor, and then locate the
<appSettings>
section.Add a line to the
appSettings
section to point to the folder that you just created:<add key="dataDirectory" value="NewCacheRootFolderLocation" />
For example, you would add the following line if you created a cache root folder that is named cacheroot in the temp directory of a hard drive, as in the earlier example:
<add key="dataDirectory" value="d:\temp\cacheroot" />
Save and close the web.config file.
Note
To maximize performance, copy the files from the old cache folder to the new cache folder.
Open a Command Prompt window, enter iisreset, and then press ENTER.
Delete the old cache root folder.
Note
By default, the cache root folder is located at %programfiles%\Azure DevOps Server 2019\Version Control Proxy\Web Services\VersionControlProxy\Data.
Change limits for removing files from the cache
You can change the maximum limit on the amount of storage space that the application-tier server can use for caching files. When this limit is reached, a cleanup routine makes room for newly requested files by deleting the files with the oldest access times.
Change the limit at which old files are removed from the cache
On the application-tier server, open Windows Explorer (or File Explorer), and browse to \%programfiles%\Azure DevOps Server 2019\Application Tier\Web Services.
Open the web.config file in a text or XML editor, and then locate the
\<appSettings\>
element.Add one of the following elements:
To specify a percentage of available disk space to fill before old files are removed, add the
PercentageBasedPolicy
element. You must specify a whole number as the value of this element.For example, the following line specifies that the cache should fill up to 60% capacity of available disk space before old files are removed:
<add key="PercentageBasedPolicy" value="60" />
To specify a fixed size in MB for the cache to reach before old files are removed, add the
FixedSizeBasedPolicy
element. You must specify a whole number as the value of this element.For example, the following line specifies that the cache should reach 500 MB before old files are removed:
<add key="FixedSizeBasedPolicy" value="500" />
Note
If both the
FixedSizeBasedPolicy
andPercentageBasedPolicy
elements are specified, the value of theFixedSizeBasedPolicy
element is used instead of the value of thePercentageBasedPolicy
element.
Save and close the web.config file.
Open a Command Prompt window, enter iisreset, and then press ENTER.
Change the amount of cache to free when removing old files
On the application-tier server, open Windows Explorer (or File Explorer), and browse to %programfiles%\Azure DevOps Server 2019\Application Tier\Web Services\.
Open the web.config file in a text or XML editor, locate the
<appSettings>
element, and then add theCacheDeletionPercent
element.For example, the following line specifies to free 50% of the cache when removing old files:
<add key="CacheDeletionPercent" value="50" />
Save and close the web.config file.
Open a Command Prompt window, enter iisreset, and then press ENTER.