---
type: api
title: Throttle a reindex operation
description: Change the number of requests per second for a particular reindex operation.
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/operation/operation-reindex-rethrottle
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/operation/operation-reindex-rethrottle
products:
  - Elasticsearch
---

# Throttle a reindex operation

Availability: 2.4+

## Paths

- `POST` `/_reindex/{task_id}/_rethrottle`

- [Api key auth](/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/authentication#apikeyauth)
- [Basic auth](/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/authentication#basicauth)
- [Bearer auth](/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/authentication#bearerauth)

#### Path Parameters

- `task_id` (string Id)
  The task identifier, which can be found by using the tasks API.

## Description

Change the number of requests per second for a particular reindex operation.
For example:

```
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.
This behavior prevents scroll timeouts.

## Query String Parameters

- `requests_per_second` (number)
  The throttle for this request in sub-requests per second.
It can be either `-1` to turn off throttling or any decimal number like `1.7` or `12` to throttle to that level.

## Response

`application/json`

- `nodes` (map string to ReindexNode)
  Map values ({} ReindexNode)
  - `attributes` (map string to string)
  - `host` (string)
  - `ip` (string)
  - `name` (string Name)
  - `roles` (NodeRoles)
    Values: `master`, `data`, `data_cold`, `data_content`, `data_frozen`, `data_hot`, `data_warm`, `client`, `ingest`, `ml`, `voting_only`, `transform`, `remote_cluster_client`, `coordinating_only`
  - `transport_address` (string)
  - `tasks` (map string to ReindexTask)
    Map values ({} ReindexTask)
    - `action` (string)
    - `cancellable` (boolean)
    - `description` (string)
    - `id` (number)
    - `node` (string Name)
    - `running_time_in_nanos` (DurationValueUnitNanos)
    - `start_time_in_millis` (EpochTimeUnitMillis)
    - `status` ({} ReindexStatus)
      - `batches` (number)
        The number of scroll responses pulled back by the reindex.
      - `created` (number)
        The number of documents that were successfully created.
      - `deleted` (number)
        The number of documents that were successfully deleted.
      - `noops` (number)
        The number of documents that were ignored because the script used for the reindex returned a `noop` value for `ctx.op`.
      - `requests_per_second` (number)
        The number of requests per second effectively executed during the reindex.
      - `retries` ({} Retries)
        The number of retries attempted by reindex. `bulk` is the number of bulk actions retried and `search` is the number of search actions retried.
        - `bulk` (number)
          The number of bulk actions retried.
        - `search` (number)
          The number of search actions retried.
      - `throttled` (string Duration)
      - `throttled_millis` (DurationValueUnitMillis)
        Number of milliseconds the request slept to conform to `requests_per_second`.
      - `throttled_until` (string Duration)
      - `throttled_until_millis` (DurationValueUnitMillis)
        This field should always be equal to zero in a `_reindex` response.
It only has meaning when using the Task API, where it indicates the next time (in milliseconds since epoch) a throttled request will be executed again in order to conform to `requests_per_second`.
      - `total` (number)
        The number of documents that were successfully processed.
      - `updated` (number)
        The number of documents that were successfully updated, for example, a document with same ID already existed prior to reindex updating it.
      - `version_conflicts` (number)
        The number of version conflicts that reindex hits.
    - `type` (string)
    - `headers` (HttpHeaders)
## Code Examples

#### Console

```console
POST _reindex/r1A2WoRbTwKZ516z6NEs5A:36619/_rethrottle?requests_per_second=-1
```

#### JavaScript

```javascript
const response = await client.reindexRethrottle({
  task_id: "r1A2WoRbTwKZ516z6NEs5A:36619",
  requests_per_second: "-1",
});
```

#### Python

```python
resp = client.reindex_rethrottle(
    task_id="r1A2WoRbTwKZ516z6NEs5A:36619",
    requests_per_second="-1",
)
```

#### curl

```curl
curl -X POST "$ELASTICSEARCH_URL/_reindex/r1A2WoRbTwKZ516z6NEs5A:36619/_rethrottle?requests_per_second=-1" \
  -H "Authorization: ApiKey $ELASTIC_API_KEY"
```

#### Java

```java
client.reindexRethrottle(r -> r
    .requestsPerSecond(-1.0F)
    .taskId("r1A2WoRbTwKZ516z6NEs5A:36619")
);
```

#### C#

```c#
var response = await client
    .ReindexRethrottleAsync(taskId: "r1A2WoRbTwKZ516z6NEs5A:36619", d1 => d1
        .RequestsPerSecond(-1f)
    );
```

#### PHP

```php
$resp = $client->reindexRethrottle([
    "task_id" => "r1A2WoRbTwKZ516z6NEs5A:36619",
    "requests_per_second" => "-1",
]);
```

#### Ruby

```ruby
response = client.reindex_rethrottle(
  task_id: "r1A2WoRbTwKZ516z6NEs5A:36619",
  requests_per_second: "-1"
)
```

