Cluster manager task throttling

    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.

    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.

    You can set throttling limits by specifying them in the cluster_manager.throttling.thresholds object and updating the . 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.

    The request has the following format:

    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
    • 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-snapshot
    • update-snapshot-state
    • restore-snapshot
    • cluster-reroute-api

    Example request

    The following request sets the throttling threshold for the put-mapping task type to 100:

    1. PUT _cluster/settings
    2. {
    3. "persistent": {
    4. "cluster_manager.throttling.thresholds": {
    5. "put-mapping": {
    6. "value": 100
    7. }
    8. }
    9. }

    Set the threshold to -1 to disable throttling for a task type.