Redigera

Dela via


Server configuration: ADR Cleaner Thread Count

Applies to: SQL Server 2022 (16.x) and later versions

This configuration setting is used for accelerated database recovery (ADR). The cleaner is an asynchronous process that wakes up periodically and cleans page versions that aren't needed.

By default, this configuration setting is set to 1. This means that the cleaner uses a single thread to clean persistent version store (PVS) in all databases on the database engine instance.

If the cleaner performance is insufficient and you observe that PVS size is reduced too slowly or remains large, you can increase this configuration to make the cleaner multi-threaded.

Important

PVS cleanup might be slow or blocked due to workload activity. Before increasing this configuration value, review Troubleshoot accelerated database recovery. If PVS cleanup is slow or blocked for one of the reasons mentioned in that article, follow the recommendations in the article instead of increasing the ADR Cleaner Thread Count configuration value.

Remarks

Increasing the ADR Cleaner Thread Count configuration value to a large value isn't recommended. First start with a small increase, and then gradually increase the value incrementally until cleaner performance improves sufficiently. For example, you might increase the value to 2, and then to 4.

Database engine instances with many databases that experience large PVS growth might require higher values of this setting.

Regardless of configuration, the cleaner does not use more threads than the number of logical CPUs.

Examples

The following example sets the number of PVS cleaner threads to 2.

EXEC sp_configure 'show advanced options', 1;
RECONFIGURE;
GO
EXEC sp_configure 'ADR Cleaner Thread Count', 2;
RECONFIGURE;
GO