# Re-index API creates multiple tasks

**URL:** https://discuss.elastic.co/t/re-index-api-creates-multiple-tasks/121571
**Category:** Elasticsearch
**Created:** [February 26, 2018, 10:09pm UTC](https://discuss.elastic.co/t/re-index-api-creates-multiple-tasks/121571 "2018-02-26T22:09:51Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![ayushsangani](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ayushsangani/32/9612_2.png) [@ayushsangani](https://discuss.elastic.co/u/ayushsangani)
#### Post date: [February 26, 2018, 10:09pm UTC](https://discuss.elastic.co/t/re-index-api-creates-multiple-tasks/121571/1 "2018-02-26T22:09:51Z")

</div>

Hey all,

ES version: 2.4.3

I have been using re-index API since it's launch in 2.X, it's been working fine until recently/last year. I'm noticing that whenever I execute a reindex request, it starts with one task. After a minute or so reindex API spawns multiple tasks doing the same operation which in-turn puts a lot of load on our server and brings it down.

Request to start reindexing:

```auto
POST /_reindex?refresh&wait_for_completition=false
{
	 "conflicts": "proceed",
	 "source": {
			"index": "stage-index-1",
			"size": 10000
	 },
	 "dest": {
			"index": "stage-index-0"
	 }
}

```

After few minutes status of reindex task:

```auto
GET /_tasks/?pretty&detailed=true&actions=*reindex
{
  "nodes": {
    "4_MedlkOWRJ-dXEgd8TYLsg": {
      "name": "stage-search-1b",
      "transport_address": "10.99.111.176:9300",
      "host": "10.91.000.146",
      "ip": "10.91.000.146:9300",
      "attributes": {
        "aws_availability_zone": "us-east-1d",
        "data": "false",
        "zone": "us-east-1d",
        "master": "true"
      },
      "tasks": {
        "4_MedlkOWRJ-dXEgd8TYLsg:16307": {
          "node": "4_MedlkOWRJ-dXEgd8TYLsg",
          "id": 16307,
          "type": "transport",
          "action": "indices:data/write/reindex",
          "status": {
            "total": 1720111,
            "updated": 432,
            "created": 469568,
            "deleted": 0,
            "batches": 48,
            "version_conflicts": 0,
            "noops": 0,
            "retries": 0,
            "throttled_millis": 0,
            "requests_per_second": "unlimited",
            "throttled_until_millis": 0
          },
          "description": "",
          "start_time_in_millis": 1519681855045,
          "running_time_in_nanos": 213645628823
        },
        "5_MeU4OWRJ-dXEgd8TYLsg:17996": {
          "node": "5_MeU4OWRJ-dXEgd8TYLsg",
          "id": 17996,
          "type": "transport",
          "action": "indices:data/write/reindex",
          "status": {
            "total": 1720111,
            "updated": 209021,
            "created": 979,
            "deleted": 0,
            "batches": 22,
            "version_conflicts": 0,
            "noops": 0,
            "retries": 0,
            "throttled_millis": 0,
            "requests_per_second": "unlimited",
            "throttled_until_millis": 0
          },
          "description": "",
          "start_time_in_millis": 1519681975056,
          "running_time_in_nanos": 93635535622
        }
      }
    }
  }
}

```

This task split from 1-2 tasks gets changed to 4-5 tasks and then host crashes.

I also tried changing scroll size to 5000, but reindex still doesn't finish.

Any help would be greatly appreciated.

Thanks,  
Ayush

---

<div class="post-metadata">

### Author: ![ayushsangani](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ayushsangani/32/9612_2.png) [@ayushsangani](https://discuss.elastic.co/u/ayushsangani)
#### Post date: [February 28, 2018, 6:56pm UTC](https://discuss.elastic.co/t/re-index-api-creates-multiple-tasks/121571/2 "2018-02-28T18:56:02Z")

</div>

@warkolm or @nik9000 any help here will be appreciated.  
Thanks!

---

<div class="post-metadata">

### Author: ![kahndor](https://avatars.discourse-cdn.com/v4/letter/k/97f17d/32.png) [@kahndor](https://discuss.elastic.co/u/kahndor)
#### Post date: [March 21, 2018, 2:41pm UTC](https://discuss.elastic.co/t/re-index-api-creates-multiple-tasks/121571/3 "2018-03-21T14:41:47Z")

</div>

I have noticed the same behavior and I am running ES 6.2.2

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [April 18, 2018, 2:42pm UTC](https://discuss.elastic.co/t/re-index-api-creates-multiple-tasks/121571/4 "2018-04-18T14:42:00Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
