All Products
Search
Document Center

Tair:Enable dynamic frequency control for Tair background tasks

Last Updated:Dec 07, 2023

After you enable the dynamic-hz (dynamic frequency control) feature for a Tair instance, the instance automatically adjusts the hz value based on the current number of connections. This prevents the instance from becoming overwhelmed when an excessive number of connections are scanned in a single task.

Background information

The hz parameter specifies the frequency at which Tair runs background tasks. The tasks include closing client connections that have timed out and evicting expired keys. For more information, see Change the frequency of Tair background tasks .

During the processing of client connections, each background task scans a specific number of connections, which is determined by the clients/hz value. The number of connections that are scanned by a task increases with the number of connections to an instance. If an excessive number of connections are scanned by a task, the instance may slow down and become unstable.

To address this issue, ApsaraDB for Redis Community Edition 5.0 has introduced the dynamic-hz feature. This feature allows an instance to automatically adjust the hz value based on the current number of connections to the instance. This prevents the instance from becoming overwhelmed when an excessive number of connections (clients/hz) are scanned in a single task.

The valid values of the dynamic-hz parameter are yes and no. The default value is yes. After you enable the dynamic-hz feature, the value that you specify for the hz parameter is assigned to the configured_hz parameter as the baseline frequency. Tair adjusts the hz value based on the number of client connections to the Tair instance. The hz value increases with the number of client connections. In this case, Tair runs background tasks more frequently.

You can run the INFO command to obtain the baseline value and the actual hz value after dynamic adjustment.

Prerequisites

The instance for which you want to enable the dynamic-hz feature is a DRAM-based or persistent memory-optimized instance. For more information, see DRAM-based instances or Persistent memory-optimized instances.

Procedure

  1. Log on to the Tair console and go to the Instances page. In the top navigation bar, select the region in which the instance that you want to manage resides. Then, find the instance and click the instance ID.

  2. In the left-side navigation pane, click System Parameters.

  3. On the page that appears, find the dynamic-hz parameter and click Modify in the Actions column.

  4. In the dialog box that appears, perform the following steps:

    1. Configure the dynamic-hz parameter.

    2. Click OK.

Related operations

Operation

Description

DescribeParameters

Queries the configuration and operational parameters of a Tair instance.

ModifyInstanceConfig

Modifies the values of parameters of a Tair instance.