# During reindex, cpu spike

**URL:** <https://discuss.elastic.co/t/during-reindex-cpu-spike/83786>\
**Category:** Elasticsearch\
**Created:** [April 27, 2017, 3:36am UTC](https://discuss.elastic.co/t/during-reindex-cpu-spike/83786 "2017-04-27T03:36:09Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![weibin.wu](https://avatars.discourse-cdn.com/v4/letter/w/4491bb/32.png) [@weibin.wu](https://discuss.elastic.co/u/weibin.wu)\
**Post date:** [April 27, 2017, 3:36am UTC](https://discuss.elastic.co/t/during-reindex-cpu-spike/83786/1 "2017-04-27T03:36:09Z")

</div>

Hi Elasticsearch:

Data volume: 212mb  
Shards: 5  
version: 2.4  
nodes: 3  
replica: 1

Our cluster will create a new index and reindex to the new index every night.  
During the reindex period, CPU bump up from 20% to 80%.

Is there a way to slow down the reindex process to avoid the CPU spike?

---

<div class="post-metadata">

**Author:** ![nik9000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nik9000/32/44947_2.png) [@nik9000](https://discuss.elastic.co/u/nik9000)\
**Post date:** [April 27, 2017, 2:53pm UTC](https://discuss.elastic.co/t/during-reindex-cpu-spike/83786/2 "2017-04-27T14:53:30Z")

</div>

Have a look at `requests_per_second` [here](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html#_url_parameters_3).

---

<div class="post-metadata">

**Author:** ![weibin.wu](https://avatars.discourse-cdn.com/v4/letter/w/4491bb/32.png) [@weibin.wu](https://discuss.elastic.co/u/weibin.wu)\
**Post date:** [May 9, 2017, 10:35am UTC](https://discuss.elastic.co/t/during-reindex-cpu-spike/83786/3 "2017-05-09T10:35:56Z")

</div>

Thanks for lighting me.  
Can I check whether my request is correct?

Since after I apply the requests\_per\_second, nothing changed.  
curl -XPOST 'localhost:9200/\_reindex?requests\_per\_second=100&wait\_for\_completion=false' -d '  
{  
"source": {  
"index": "work\_index\_2017-04-03"  
},  
"dest": {  
"index": "work\_index\_test"  
}  
}'

---

<div class="post-metadata">

**Author:** ![weibin.wu](https://avatars.discourse-cdn.com/v4/letter/w/4491bb/32.png) [@weibin.wu](https://discuss.elastic.co/u/weibin.wu)\
**Post date:** [May 11, 2017, 2:56am UTC](https://discuss.elastic.co/t/during-reindex-cpu-spike/83786/4 "2017-05-11T02:56:01Z")

</div>

I just found out the version is actually 2.3.5

So I think thats why my request is failed. There is no requests\_per\_second in 2.3 right?

How can I control the CPU spike at this place?

---

<div class="post-metadata">

**Author:** ![nik9000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nik9000/32/44947_2.png) [@nik9000](https://discuss.elastic.co/u/nik9000)\
**Post date:** [May 11, 2017, 2:59am UTC](https://discuss.elastic.co/t/during-reindex-cpu-spike/83786/5 "2017-05-11T02:59:46Z")

</div>

It looks like I added it in 2.4:

> <https://github.com/elastic/elasticsearch/pull/18020>

I don't know of any way to slow down reindex in 2.3.

---

<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:** [June 8, 2017, 3:06am UTC](https://discuss.elastic.co/t/during-reindex-cpu-spike/83786/6 "2017-06-08T03:06:18Z")

</div>

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