# How to minimize the reindexing time

**URL:** <https://discuss.elastic.co/t/how-to-minimize-the-reindexing-time/285739>\
**Category:** Elasticsearch\
**Tags:** reindex\
**Created:** [October 2, 2021, 3:22pm UTC](https://discuss.elastic.co/t/how-to-minimize-the-reindexing-time/285739 "2021-10-02T15:22:49Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aniket\_Pant](https://avatars.discourse-cdn.com/v4/letter/a/77aa72/32.png) [@Aniket\_Pant](https://discuss.elastic.co/u/Aniket_Pant)\
**Post date:** [October 2, 2021, 3:22pm UTC](https://discuss.elastic.co/t/how-to-minimize-the-reindexing-time/285739/1 "2021-10-02T15:22:49Z")

</div>

Using ELK 7.13 cluster 3 master 6 data nodes and 2 coordinate nodes  
**Master node configuration**

1. Heap Size: 8gb
2. Storage: 50gb(ssd)
3. CPU: 4

**Data node configuration**

1. Heap Size: 28gb
2. Storage: 1tb(ssd)
3. CPU: 8

**Coordinate node configuration**

1. Heap Size: 8gb
2. Storage: 50gb(ssd)
3. CPU: 4

```auto
health status index uuid pri rep docs.count docs.deleted store.size pri.store.size
green open log-wlb-sysmon-2021.10.01-000014 OaDubXBDTFuwVqYjLIIcXg 1 1 87312747 0 114.4gb 57.2gb
green open log-wlb-sysmon-2021.09.30-000013 _ukLur8LR0aY4pUJPnGIcw 1 1 85912426 0 113.9gb 56.9gb
green open log-wlb-sysmon-2021.08.16-000015 EtF6odgpQGGRjQ0Nywqtxg 1 1 102154111 0 102.2gb 51.1gb
green open log-wlb-sysmon-2021.10.02-000015 sc3bQuCeQEmABwrMMjh8Gw 1 0 1280767 0 592.9mb 592.9mb
green open log-wlb-sysmon-2021.09.23-000019 tevWknvdRY-XwrEARoNY9g 1 1 44918363 166891 53.9gb 26.9gb
green open log-wlb-sysmon-2021.08.27-000017 hAGeCkqhRlCBvmwBLonjaQ 1 1 93303600 0 102gb 51gb
green open log-wlb-sysmon-2021.08.19-000016 mkBAnhNMReyHzw0PJwkCHg 1 1 83527835 0 102gb 51gb
green open log-wlb-sysmon-2021.09.07-000018 HuDxDct7RGKOcuYFXCKA8w 1 1 92614553 0 101.7gb 50.8gb

```

I want to reindexing these indices.`log-wlb-sysmon-2021.09.30-000013,log-wlb-sysmon-2021.10.01-000014` have been reindexed and currently i am reindexing `log-wlb-sysmon-2021.10.02-000015` index.  
You can see that `log-wlb-sysmon-2021.09.30-000013,log-wlb-sysmon-2021.10.01-000014` has taken 2 days to reindex.

Although i close the replica and stop the refresh process and then start the reindexing process

```auto
PUT %3Clog-wlb-sysmon-%7Bnow%2Fd%7D-000015%3E 
{
"aliases": {
   "log-wlb-sysmon": {
      "is_write_index": false      
   }
 },
 "settings": {
   "index.lifecycle.parse_origination_date":true,
  "refresh_interval": "-1"
   , "number_of_replicas": 0
 }
}

```

Reindexing million of documents takes a day and then enabling replica and force merge takes 3 to 4 hours.  
But the question is i want to reindex this millions of documents in just 2-3 hours or how can i reduce this time consumption while running reindexing api.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [October 2, 2021, 3:55pm UTC](https://discuss.elastic.co/t/how-to-minimize-the-reindexing-time/285739/2 "2021-10-02T15:55:14Z")

</div>

Are you using slices to reindex ?

---

<div class="post-metadata">

**Author:** ![Aniket\_Pant](https://avatars.discourse-cdn.com/v4/letter/a/77aa72/32.png) [@Aniket\_Pant](https://discuss.elastic.co/u/Aniket_Pant)\
**Post date:** [October 2, 2021, 6:29pm UTC](https://discuss.elastic.co/t/how-to-minimize-the-reindexing-time/285739/3 "2021-10-02T18:29:22Z")

</div>

No,I am not using slices option in reindex.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [October 3, 2021, 1:42am UTC](https://discuss.elastic.co/t/how-to-minimize-the-reindexing-time/285739/4 "2021-10-03T01:42:30Z")

</div>

You should.

---

<div class="post-metadata">

**Author:** ![Aniket\_Pant](https://avatars.discourse-cdn.com/v4/letter/a/77aa72/32.png) [@Aniket\_Pant](https://discuss.elastic.co/u/Aniket_Pant)\
**Post date:** [October 3, 2021, 1:55am UTC](https://discuss.elastic.co/t/how-to-minimize-the-reindexing-time/285739/5 "2021-10-03T01:55:35Z")

</div>

```auto
POST _reindex
{
  "source": {
    "index": "my-index-000001",
    "slice": {
      "id": 1,
      "max": 2
    }
  },
  "dest": {
    "index": "my-new-index-000001"
  }
}

```

What is id,max because i am gonna use this first time in my reindex

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [October 3, 2021, 8:24am UTC](https://discuss.elastic.co/t/how-to-minimize-the-reindexing-time/285739/6 "2021-10-03T08:24:50Z")

</div>

I'd just use something like:

```auto
POST _reindex?slices=5
{
  "source": {
    "index": "my-index-000001"
  },
  "dest": {
    "index": "my-new-index-000001"
  }
}

```

And see if this improves things.

---

<div class="post-metadata">

**Author:** ![Aniket\_Pant](https://avatars.discourse-cdn.com/v4/letter/a/77aa72/32.png) [@Aniket\_Pant](https://discuss.elastic.co/u/Aniket_Pant)\
**Post date:** [October 3, 2021, 11:01am UTC](https://discuss.elastic.co/t/how-to-minimize-the-reindexing-time/285739/7 "2021-10-03T11:01:30Z")

</div>

```auto
POST _reindex?slices=5
{
  "source": {
    "index": "my-index-000001"
    "size": 8000
  },
  "dest": {
    "index": "my-new-index-000001"
  }
}

```

Can i use size parameter in source.Will it work?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [October 3, 2021, 11:31am UTC](https://discuss.elastic.co/t/how-to-minimize-the-reindexing-time/285739/8 "2021-10-03T11:31:42Z")

</div>

You can but don't overload your nodes.

---

<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:** [October 31, 2021, 5:00pm UTC](https://discuss.elastic.co/t/how-to-minimize-the-reindexing-time/285739/10 "2021-10-31T17:00:40Z")

</div>

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