All Products
Search
Document Center

Tair:Change the frequency of Tair background tasks

Last Updated:Dec 11, 2023

You can change the value of the hz parameter to adjust the frequency at which Tair runs background tasks to evict expired keys and close client connections that have timed out.

Relationship between background tasks and the hz parameter

To periodically check the status of resources and services and perform operations based on specified policies, Tair calls an internal function to run background tasks. The following list provides examples of background tasks:

  • Evict expired keys.

  • Close client connections that have timed out.

  • Update statistics.

The preceding background tasks ensure the normal operation of Tair . The frequency at which these tasks are run is determined by the hz parameter. By default, the hz parameter is set to 10, which indicates that the tasks are run 10 times per second.

Valid values and suggested settings for the hz parameter

The valid values of the hz parameter are 1 to 500. If you increase the value of hz, Tair runs background tasks more frequently. This can increase CPU utilization. In most cases, you can use the default value 10. If you want to run specific background tasks more frequently, specify a value between 10 and 100. We recommend that you do not set the hz parameter to a value greater than 100 to prevent a sharp increase in CPU utilization.

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 hz parameter and click Modify in the Actions column.

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

    1. Change the value of the hz parameter based on your business requirements.

    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.