Change the maximum number of documents to index per second for a particular reindex operation. For example, to unthrottle to unlimited documents per second:
POST _reindex/r1A2WoRbTwKZ516z6NEs5A:36619/_rethrottle?requests_per_second=-1
Rethrottling that speeds up the query takes effect immediately. Rethrottling that slows down the query will take effect after completing the current batch of documents. This behavior prevents scroll timeouts.
This API follows reindex tasks across node-shutdown relocations, so callers can keep using the original task ID throughout the lifetime of the operation. The relocated task ID is also accepted and is followed transparently. In either case, returned task IDs and timings reflect the original task, not its relocated successor.
The rethrottle may not have been applied to any tasks if either node_failures or task_failures are non-empty, or if the response contains
no successfully rethrottled tasks — that is, no entries under nodes (returned with the default
group_by=nodes in stack) or under tasks (returned in serverless, or in stack with
group_by=none or group_by=parents).
Path parameters
-
The task identifier, returned when creating a reindex task, or by listing tasks via
GET /_reindexorGET /_tasks. In stack, can be either the original task ID or the task ID of the relocated task.
Query parameters
-
The maximum number of documents to index per second, across the entire reindex operation (including slices). It can be either
-1to turn off throttling or any decimal number like1.7or12to throttle to that level. -
The way to group the tasks in the response. We recommend setting this to
none, which provides the cleanest response format.Supported values include:
nodes: Group tasks by node ID.parents: Group tasks by parent task ID.none: Do not group tasks.
Values are
nodes,parents, ornone.
POST _reindex/r1A2WoRbTwKZ516z6NEs5A:36619/_rethrottle?requests_per_second=-1
resp = client.reindex_rethrottle(
task_id="r1A2WoRbTwKZ516z6NEs5A:36619",
requests_per_second="-1",
)
const response = await client.reindexRethrottle({
task_id: "r1A2WoRbTwKZ516z6NEs5A:36619",
requests_per_second: "-1",
});
response = client.reindex_rethrottle(
task_id: "r1A2WoRbTwKZ516z6NEs5A:36619",
requests_per_second: "-1"
)
$resp = $client->reindexRethrottle([
"task_id" => "r1A2WoRbTwKZ516z6NEs5A:36619",
"requests_per_second" => "-1",
]);
curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_reindex/r1A2WoRbTwKZ516z6NEs5A:36619/_rethrottle?requests_per_second=-1"
client.reindexRethrottle(r -> r
.requestsPerSecond(-1.0F)
.taskId("r1A2WoRbTwKZ516z6NEs5A:36619")
);
{
"tasks": [
{
"node": "r1A2WoRbTwKZ516z6NEs5A",
"id": 36619,
"type": "transport",
"action": "indices:data/write/reindex",
"status": {
"total": 11500,
"updated": 0,
"created": 4000,
"deleted": 0,
"batches": 4,
"version_conflicts": 0,
"noops": 0,
"retries": {
"bulk": 0,
"search": 0
},
"throttled_millis": 0,
"requests_per_second": 10.0,
"throttled_until_millis": 0
},
"description": "reindex from [my-source-index] to [my-dest-index]",
"start_time_in_millis": 1762190000000,
"running_time_in_nanos": 4200000000,
"cancellable": true,
"headers": {}
}
]
}
{
"node_failures": [
{
"type": "failed_node_exception",
"reason": "Failed node [non_existing_node]",
"node_id": "non_existing_node",
"caused_by": {
"type": "no_such_node_exception",
"reason": "No such node [non_existing_node]",
"node_id": "non_existing_node"
}
}
],
"tasks": []
}
{
"task_failures": [
{
"task_id": 36619,
"node_id": "r1A2WoRbTwKZ516z6NEs5A",
"status": "SERVICE_UNAVAILABLE",
"reason": {
"type": "status_exception",
"reason": "cannot rethrottle, task is being relocated"
}
}
],
"tasks": {}
}