-
Notifications
You must be signed in to change notification settings - Fork 685
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
Merged
Merged
Changes from 6 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
d639ba7
Adds cluster manager task throttling documentation
kolchfa-aws 19d416f
Update cluster-manager-task-throttling.md
kolchfa-aws 4895a22
Rewording
kolchfa-aws 280c12d
More rewording
kolchfa-aws 94f3ede
Reworded for clarity
kolchfa-aws 41a90cb
Incorporated doc review comments
kolchfa-aws 1543e14
More doc review comments
kolchfa-aws 02fd114
Update _opensearch/cluster-manager-task-throttling.md
kolchfa-aws 0429040
Update _opensearch/cluster-manager-task-throttling.md
kolchfa-aws File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 set throttling limits. The cluster manager uses the throttling limits to determine whether to reject a task. | ||
|
|
||
| The cluster manager rejects a task based on its type. 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. | ||
|
|
||
| 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 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. | ||
|
|
||
| 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 | ||
| :--- | :--- | ||
| 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 `task-type` type in the cluster manager's pending task queue. Default is `-1` (no task throttling). | ||
|
|
||
| ## 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} | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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!