Use the cold-search plugin

更新时间:
复制 MD 格式

In OpenStore storage clusters, cold queries on hot-and-cold shared compute nodes can consume significant CPU and memory resources, degrading hot data query performance. The cold-search plugin limits CPU and memory resources for cold queries and applies circuit breaking to keep hot data queries stable.

Usage notes

The cold-search plugin is installed by default and cannot be uninstalled. You can view it on the plugin configuration page. To use this plugin, the following conditions must be met:

  • The instance version is 7.10.0 or later, and the kernel version is 1.6.0 or later.

  • For the data node instance family, select the hot-and-cold shared compute type.

Configure CPU limits

Run the following command to configure CPU resource limits for cold queries. The parameter values are examples. For detailed descriptions and default values, see the table below.

PUT _cluster/settings
{
  "persistent":{
    "apack.cold_search.cpu.cold_max":0.7,
    "apack.cold_search.cpu.normal_share":1024,
    "apack.cold_search.cpu.cold_share":2
  }
}

Parameter

Type

Default

Description

apack.cold_search.cpu.cold_max

Float

0.7

The maximum proportion of CPU that cold queries can use per second on a single node.

For example, if a node has 4 CPU cores and this parameter is set to 0.5, cold queries can use up to 4 * 0.5 = 2 CPU cores per second.

apack.cold_search.cpu.normal_share

Integer

100

The CPU resource weight for non-cold queries. The minimum value is 2. Works with apack.cold_search.cpu.cold_share to control the CPU resource ratio between non-cold and cold queries. This setting takes effect only when node CPU utilization reaches 100%. For example, if apack.cold_search.cpu.normal_share is 90 and apack.cold_search.cpu.cold_share is 10, the ratio is 90:10. If non-cold queries use 50% of the CPU and cold queries use 40%, circuit breaking is not triggered because total utilization (90%) is below 100%.

apack.cold_search.cpu.cold_share

Integer

10

The CPU resource weight for cold queries. The minimum value is 2. Works with apack.cold_search.cpu.normal_share to control the CPU resource ratio between non-cold and cold queries.

Configure memory limits

Run the following command to configure memory resource limits for cold queries.

PUT _cluster/settings
{
  "persistent":{
      "apack.cold_search.mem.cold_max_percent": "80%",
      "apack.cold_search.mem.cold_delay_interval":"5s",
      "apack.cold_search.mem.jvm_max_percent": "90%",
      "apack.cold_search.mem.delay_interval": "2s"
  }
}

Parameter

Type

Default

Description

apack.cold_search.mem.cold_max_percent

Percentage or capacity unit

80%

The circuit breaking threshold for memory consumed by cold queries.

apack.cold_search.mem.cold_delay_interval

Time value

5s

The delay before circuit breaking is triggered once the memory usage of cold queries exceeds the threshold.

apack.cold_search.mem.jvm_max_percent

Percentage or capacity unit

90%

The circuit breaking threshold for total memory usage across all queries.

apack.cold_search.mem.delay_interval

Time value

2s

The delay before circuit breaking is triggered once the total memory usage for all queries exceeds the threshold.

Circuit breaking behavior

If a cold query exceeds the configured CPU or memory limits, Elasticsearch triggers circuit breaking. The system stops allocating additional CPU and memory resources to the cold query, which slows it down but does not cause it to fail.