# Reindexing in Production Environment

**URL:** <https://discuss.elastic.co/t/reindexing-in-production-environment/323543>\
**Category:** Kibana\
**Tags:** reindex\
**Created:** [January 19, 2023, 7:33pm UTC](https://discuss.elastic.co/t/reindexing-in-production-environment/323543 "2023-01-19T19:33:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![vishnu\_teja](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vishnu_teja/32/103949_2.png) [@vishnu\_teja](https://discuss.elastic.co/u/vishnu_teja)\
**Post date:** [January 19, 2023, 7:33pm UTC](https://discuss.elastic.co/t/reindexing-in-production-environment/323543/1 "2023-01-19T19:33:39Z")

</div>

Hi Everyone, Currently in our Elasticsearch cluster we have a lot of documents which need to deleted, so we are looking to re-index the used documents to a new index and delete the old index. We will be doing this in production environment, the approach is to create a new index, re-index the used documents to a new index, once done we will point the alias to new index to avoid any downtime. Questions for this approach:

1. What configuration can we use during re-indexing to not cause any latency issues to the queries during this task? (like scorll\_size, requests\_per\_second etc)

2. In order to speed up the re-indexing we are thinking about stopping refresh on the new index, will there be any issues when ingest a large amount of documents and turn on the refresh later.

3. Will there be a increase in CPU Utilization or query latency issues when we delete a large index?

Any suggestions are welcome.

Thanks.

---

<div class="post-metadata">

**Author:** ![Wave](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wave/32/117242_2.png) [@Wave](https://discuss.elastic.co/u/Wave)\
**Post date:** [February 15, 2023, 12:18am UTC](https://discuss.elastic.co/t/reindexing-in-production-environment/323543/2 "2023-02-15T00:18:19Z")

</div>

Hi @vishnu_teja! Good questions.

> [@vishnu\_teja](#):
>
> What configuration can we use during re-indexing to not cause any latency issues to the queries during this task? (like scorll\_size, requests\_per\_second etc)

By default when you start the reindex it will run as fast as it can. If you start to see search latency creep up or other performance problems you can always dial it back by setting requests\_per\_second.

> [@vishnu\_teja](#):
>
> In order to speed up the re-indexing we are thinking about stopping refresh on the new index, will there be any issues when ingest a large amount of documents and turn on the refresh later.

Yes, you should do this, and no there won't be any issues when turned on later. Just set it back to the default and you should be good to go. Also, look at turning off replicas when reindexing, and then turn it back on when done. Once the index goes green you can delete the original index.  
That brings us to your last question:

> [@vishnu\_teja](#):
>
> Will there be a increase in CPU Utilization or query latency issues when we delete a large index?

No, that shouldn't happen.

Good luck, and happy reindexing.

---

<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:** [March 15, 2023, 12:19am UTC](https://discuss.elastic.co/t/reindexing-in-production-environment/323543/3 "2023-03-15T00:19:12Z")

</div>

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