-
Notifications
You must be signed in to change notification settings - Fork 686
Adds cluster manager task throttling documentation #1826
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 5 commits
d639ba7
19d416f
4895a22
280c12d
94f3ede
41a90cb
1543e14
02fd114
0429040
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,104 @@ | ||||||
| --- | ||||||
| layout: default | ||||||
| title: Cluster manager task throttling | ||||||
| nav_order: 70 | ||||||
| has_children: false | ||||||
| --- | ||||||
|
|
||||||
| # Cluster manager task throttling | ||||||
|
|
||||||
| For many cluster state updates, such as defining a mapping or creating an index, nodes submit tasks to the cluster manager. The cluster manager maintains a pending task queue for these tasks and runs them in a single-threaded environment. When nodes send tens of thousands of resource-intensive tasks, like `put-mapping` or snapshot tasks, these tasks pile up in the queue, and the cluster manager is flooded. This affects the cluster manager performance, and may in turn affect the availability of the whole cluster. | ||||||
|
|
||||||
| The first line of defense is to implement mechanisms in the caller nodes to avoid task overload on the cluster manager. However, even with those mechanisms in place, the cluster manager needs a built-in way to protect itself---cluster manager task throttling. | ||||||
|
kolchfa-aws marked this conversation as resolved.
Outdated
|
||||||
|
|
||||||
| To turn on cluster manager task throttling, you need to specify to throttle tasks by setting throttling limits. The cluster manager uses the throttling limits to determine whether to reject a task. | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. specify throttling tasks? |
||||||
|
|
||||||
| The cluster manager rejects tasks on the task type basis. For any incoming task, the cluster manager evaluates the total number of tasks of the same type in the pending task queue. If this number exceeds the threshold for this task type, the cluster manager rejects the incoming task. Rejecting a task does not affect tasks of a different type. For example, if the cluster manager rejects a `put-mapping` task, it can still accept a subsequent `create-index` task. | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. rejects tasks on the basis of task types? |
||||||
|
|
||||||
| When the cluster manager rejects a task, the node performs retries with exponential backoff to resubmit the task to the cluster manager. If retries are unsuccessful within the timeout period, OpenSearch returns a cluster timeout error. | ||||||
|
|
||||||
| ## Setting throttling limits | ||||||
|
|
||||||
| You can set the throttling limits by specifying them in the `cluster_manager.throttling.thresholds` object and updating the [OpenSearch cluster settings]({{site.url}}{{site.baseurl}}/api-reference/cluster-settings). The setting is dynamic, so you can change the behavior of this feature without restarting your cluster. | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. set throttling limits? |
||||||
|
|
||||||
| By default, throttling is disabled for all task types. | ||||||
| {: .note} | ||||||
|
|
||||||
| The request has the following format: | ||||||
|
|
||||||
| ```json | ||||||
| PUT _cluster/settings | ||||||
| { | ||||||
| "persistent": { | ||||||
| "cluster_manager.throttling.thresholds" : { | ||||||
| "<task-type>" : { | ||||||
| "value" : <threshold limit> | ||||||
| } | ||||||
| } | ||||||
| } | ||||||
| } | ||||||
| ``` | ||||||
|
|
||||||
| The following table describes the `cluster_manager.throttling.thresholds` object. | ||||||
|
|
||||||
| Field name | Description | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| :--- | :--- | ||||||
| task-type | The task type. See [supported task types](#supported-task-types) for a list of valid values. | ||||||
| value | The maximum number of tasks of the type specified by the `task-type` in the cluster manager's pending task queue. Default is `-1` (no task throttling). | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. tasks of the |
||||||
|
|
||||||
| ## Supported task types | ||||||
|
|
||||||
| The following task types are supported: | ||||||
|
|
||||||
| - `create-index` | ||||||
| - `update-settings` | ||||||
| - `cluster-update-settings` | ||||||
| - `auto-create` | ||||||
| - `delete-index` | ||||||
| - `delete-dangling-index` | ||||||
| - `create-data-stream` | ||||||
| - `remove-data-stream` | ||||||
| - `rollover-index` | ||||||
| - `index-aliases` | ||||||
| - `put-mapping` | ||||||
| - `create-index-template` | ||||||
| - `remove-index-template` | ||||||
| - `create-component-template` | ||||||
| - `remove-component-template` | ||||||
| - `create-index-template-v2` | ||||||
| - `remove-index-template-v2` | ||||||
| - `put-pipeline` | ||||||
| - `delete-pipeline` | ||||||
| - `create-persistent-task` | ||||||
| - `finish-persistent-task` | ||||||
| - `remove-persistent-task` | ||||||
| - `update-task-state` | ||||||
| - `put-script` | ||||||
| - `delete-script` | ||||||
| - `put-repository` | ||||||
| - `delete-repository` | ||||||
| - `create-snapshot` | ||||||
| - `delete-snapshot` | ||||||
| - `update-snapshot-state` | ||||||
| - `restore-snapshot` | ||||||
| - `cluster-reroute-api` | ||||||
|
|
||||||
| #### Sample request | ||||||
|
|
||||||
| The following request sets the throttling threshold for the `put-mapping` task type to 100: | ||||||
|
|
||||||
| ```json | ||||||
| PUT _cluster/settings | ||||||
| { | ||||||
| "persistent": { | ||||||
| "cluster_manager.throttling.thresholds": { | ||||||
| "put-mapping": { | ||||||
| "value": 100 | ||||||
| } | ||||||
| } | ||||||
| } | ||||||
| } | ||||||
| ``` | ||||||
|
|
||||||
| Set the threshold to `-1` to disable throttling for a task type. | ||||||
| {: .note} | ||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion only:
"When nodes send tens of thousands of resource-intensive tasks, like
put-mappingor snapshot tasks, these tasks can pile up in the queue and flood the cluster manager.""This affects cluster manager performance..."
or
"This affects the cluster manager's performance..."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is good. I'll change. Thanks!