# BulkRequest causes hotspot

**URL:** <https://discuss.elastic.co/t/bulkrequest-causes-hotspot/45176>\
**Category:** Elasticsearch\
**Created:** [March 23, 2016, 2:57am UTC](https://discuss.elastic.co/t/bulkrequest-causes-hotspot/45176 "2016-03-23T02:57:54Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![kewn21](https://avatars.discourse-cdn.com/v4/letter/k/278dde/32.png) [@kewn21](https://discuss.elastic.co/u/kewn21)\
**Post date:** [March 23, 2016, 2:57am UTC](https://discuss.elastic.co/t/bulkrequest-causes-hotspot/45176/1 "2016-03-23T02:57:54Z")

</div>

I use BulkRequest to create index,but hotspot be happened,only one note is over loadavarage and io busy,other nodes is [free.Is](http://free.Is) it all the indexs in per BulkRequest will store in same shard of only one node?

---

<div class="post-metadata">

**Author:** ![Kramer\_Li](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kramer_li/32/46872_2.png) [@Kramer\_Li](https://discuss.elastic.co/u/Kramer_Li)\
**Post date:** [March 23, 2016, 3:14am UTC](https://discuss.elastic.co/t/bulkrequest-causes-hotspot/45176/2 "2016-03-23T03:14:39Z")

</div>

May be some details on your request will help. As per I know, ES should route your request to different Node by its routing method. So should not have hotspot. Also, are you trying to create a lot index? But why? a lot index means a lot shards and is it really necessary ?

---

<div class="post-metadata">

**Author:** ![kewn21](https://avatars.discourse-cdn.com/v4/letter/k/278dde/32.png) [@kewn21](https://discuss.elastic.co/u/kewn21)\
**Post date:** [March 23, 2016, 3:25am UTC](https://discuss.elastic.co/t/bulkrequest-causes-hotspot/45176/3 "2016-03-23T03:25:05Z")

</div>

I want to store logs to ES,which is 100 thousand per second.The index like the below which use the auto generate id.  
bulkRequestBuilder.add(client.prepareIndex(index\_name, index\_type).setSource(xbuilder));

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [March 23, 2016, 6:21am UTC](https://discuss.elastic.co/t/bulkrequest-causes-hotspot/45176/4 "2016-03-23T06:21:44Z")

</div>

How many nodes do you have in the cluster? Do you distribute bulk requests against evenly across the cluster? What type of hardware is your cluster deployed on? Have you done any tuning? How many shards/replicas are you indexing into?

---

<div class="post-metadata">

**Author:** ![kewn21](https://avatars.discourse-cdn.com/v4/letter/k/278dde/32.png) [@kewn21](https://discuss.elastic.co/u/kewn21)\
**Post date:** [March 23, 2016, 7:34am UTC](https://discuss.elastic.co/t/bulkrequest-causes-hotspot/45176/5 "2016-03-23T07:34:08Z")

</div>

5 nodes,bulk requests are distributed to the nodes balancing. Hardware is 16cores and 11 hard disks and 50g physical men which 30g for ES.50 shards and 0 replica and refresh\_interval is 10s.

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [March 23, 2016, 7:12pm UTC](https://discuss.elastic.co/t/bulkrequest-causes-hotspot/45176/6 "2016-03-23T19:12:55Z")

</div>

Are you using parent-child, nested documents or perhaps custom routing? Are the shards you are indexing into (if not all) evenly distributed across the nodes? Which version of Elasticsearch are you using?

---

<div class="post-metadata">

**Author:** ![kewn21](https://avatars.discourse-cdn.com/v4/letter/k/278dde/32.png) [@kewn21](https://discuss.elastic.co/u/kewn21)\
**Post date:** [March 24, 2016, 3:50am UTC](https://discuss.elastic.co/t/bulkrequest-causes-hotspot/45176/7 "2016-03-24T03:50:37Z")

</div>

The index dosen't use parent-child and custom routing.The shards are distributed to the nodes equably.Version of Elasticsearch is 2.1.1.

---

<div class="post-metadata">

**Author:** ![kewn21](https://avatars.discourse-cdn.com/v4/letter/k/278dde/32.png) [@kewn21](https://discuss.elastic.co/u/kewn21)\
**Post date:** [March 24, 2016, 4:09am UTC](https://discuss.elastic.co/t/bulkrequest-causes-hotspot/45176/8 "2016-03-24T04:09:01Z")

</div>

Using iostat to analysis to hotspot node load,Both w\_await and svctm and util is more highter than other nodes,wrqm/s and wkB/s and avgrq-sz is lower.Using vmstat show that the bo of hotspot node is lower then other nodes,buff is more highter.

---

<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:** [March 24, 2016, 12:11pm UTC](https://discuss.elastic.co/t/bulkrequest-causes-hotspot/45176/9 "2016-03-24T12:11:47Z")

</div>

I don't really know what to say other than "from here it looks like you are  
doing it right" and "that isn't normal. load should be spread out".

Sometimes you can get hot spots when Elasticsearch decides to allocate lots  
of the new indexes to one node. If that is your problem you can reach for  
the [total\_shards\_per\_node](https://www.elastic.co/guide/en/elasticsearch/reference/current/allocation-total-shards.html)  
setting. That will force Elasticsearch to allocate smoothly. If you set  
that setting to high Elasticsearch will prefer to remain yellow rather than  
allocate the shards, so be careful with it! Remove it from indexes that you  
aren't currently writing to, etc. You can tell if this is your problem by  
looking at the \_cat/shards API and seeing if all the indexes you are  
writing to are on the one node.

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [March 24, 2016, 1:42pm UTC](https://discuss.elastic.co/t/bulkrequest-causes-hotspot/45176/10 "2016-03-24T13:42:06Z")

</div>

> [@kewn21](#):
>
> only one note is over loadavarage and io busy,other nodes is free

This is not an ES issue. Do you have different hardware for the nodes, one node per server? Most likely, one of your servers has a hardware defect and is maybe auto-recovering from RAID, or something.

---

<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:** [July 5, 2017, 11:05pm UTC](https://discuss.elastic.co/t/bulkrequest-causes-hotspot/45176/11 "2017-07-05T23:05:28Z")

</div>


