Supercharging Elasticsearch with Alibaba Cloud's Aliyun-qos Plugin 🛠️.

Article hero image

Elevate your Elasticsearch game by integrating the aliyun-qos plugin on Alibaba Cloud. This powerful plugin serves as a throttle management system, ensuring your cluster remains robust and responsive, even under heavy loads. Let’s delve into the mechanics of using the aliyun-qos plugin to fine-tune your Elasticsearch performance.

Preparation Steps

Before you begin, confirm that:

  • Your cluster is running the latest aliyun-qos plugin version. Verify this via the Kibana console with:
GET /_cat/plugins?v

For Elasticsearch V7.10, the current version is 7.10.0_ali1.6.0.2. For other versions, the format typically follows -rc4. If you’re behind, follow the upgrade guide provided by Alibaba Cloud.

Note: Versions prior to rc4 may trigger an unsupported_operation_exception error.

Determining Throttling Levels

Proper throttling settings are key to avoiding performance issues. Calculate your thresholds by considering the client QPS to Elasticsearch and factoring in replica shards for write operations.

For queries:

$$ \text{Throttling threshold for queries} = \text{Client QPS to Elasticsearch} $$

For writes:

Adjust the threshold relative to the number of replica shards and include traffic from additional tasks like X-Pack Monitor, Audit, and Watcher.

Throttling Controls

By default, the aliyun-qos plugin is inactive. To toggle throttling:

To enable: For Elasticsearch V7.10:

PUT _cluster/settings
{
  "persistent": {
    "apack.qos.limiter.enabled": true
  }
}

For other versions:

PUT _cluster/settings
{
   "persistent": {
      "apack.qos.ratelimit.enabled": "true"
   }
}

To disable: Set the parameter to false or null:

PUT _cluster/settings
{
  "persistent": {
    "apack.qos.limiter.enabled": false
  }
}

Configuring a Throttle Limiter

Set up a limiter as follows:

PUT /_qos/limiter/<limiterName>
{
  "limiters": {
    "search.qps": "1000"
  },
  "tags": {
    "index": "nginx-log-*"
  }
}

Customize the limiterName, limiters, and tags as necessary, substituting nginx-log-* with your specific index pattern.

Managing Limiters

To view all limiters:

GET _qos/limiter

For a particular limiter:

GET _qos/limiter/<limiterName>

To remove limiters:

DELETE _qos/limiter/<limiterName>

Monitoring Throttling

For real-time metrics:

GET /_qos/limiter/nodes/stats
GET /_qos/limiter/nodes/{nodeId}/stats
GET /_qos/limiter/nodes/{nodeId}/stats/{limiterIds}

For historical data:

GET /_qos/limiter/metric
GET /_qos/limiter/metric/{limiterId}

Optimal performance tuning aligns with actual workloads, and these examples offer a foundation for enhancing cluster stability with Alibaba Cloud’s aliyun-qos plugin.

In Summary

Configuring the aliyun-qos plugin correctly allows Alibaba Cloud Elasticsearch to handle intense read-write activities smoothly, maintaining consistent performance. These configurations are vital for clusters facing fluctuating workloads.

Keen to embark on your Alibaba Cloud Elasticsearch journey? Discover our custom Cloud solutions and services to begin transforming your data into actionable insights. 🌐