# Stop routing search when the node is GC

**URL:** <https://discuss.elastic.co/t/stop-routing-search-when-the-node-is-gc/153757>\
**Category:** Elasticsearch\
**Created:** [October 24, 2018, 9:13am UTC](https://discuss.elastic.co/t/stop-routing-search-when-the-node-is-gc/153757 "2018-10-24T09:13:07Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ebuildy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ebuildy/32/6070_2.png) [@ebuildy](https://discuss.elastic.co/u/ebuildy)\
**Post date:** [October 24, 2018, 9:13am UTC](https://discuss.elastic.co/t/stop-routing-search-when-the-node-is-gc/153757/1 "2018-10-24T09:13:07Z")

</div>

We run a 10 data nodes cluster, 64Gb memory, 30 Gb heap, 8 cores, with elasticsearch 2.4. At least 500 searchs/seconds.

Every 3 days, we see errors because the search threads pool is full, after some investigations, the problem appears when the node is doing a GC, at 70% of heap size =\> 10%. It took some seconds but this is enough to cause trouble.

Is it possible to tell to the client node to not sending shard search to a node when the node is doing a GC ? (or when the heap is at X % so the node is going to GC)

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [October 24, 2018, 9:23am UTC](https://discuss.elastic.co/t/stop-routing-search-when-the-node-is-gc/153757/2 "2018-10-24T09:23:03Z")

</div>

No it's not, a client has no idea of that. Even if it knew a node's heap use, it doesn't know if it's in GC or will go into GC for the query it sends.

---

<div class="post-metadata">

**Author:** ![ebuildy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ebuildy/32/6070_2.png) [@ebuildy](https://discuss.elastic.co/u/ebuildy)\
**Post date:** [October 24, 2018, 9:25am UTC](https://discuss.elastic.co/t/stop-routing-search-when-the-node-is-gc/153757/3 "2018-10-24T09:25:52Z")

</div>

So the balance is totally random?

I am thinking to a new component such as "routing strategy" , so we could implement different balance strategies.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [October 24, 2018, 9:26am UTC](https://discuss.elastic.co/t/stop-routing-search-when-the-node-is-gc/153757/4 "2018-10-24T09:26:09Z")

</div>

What balance do you mean?

---

<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:** [October 24, 2018, 9:30am UTC](https://discuss.elastic.co/t/stop-routing-search-when-the-node-is-gc/153757/5 "2018-10-24T09:30:33Z")

</div>

I wonder if [adaptive replica selection](https://www.elastic.co/guide/en/elasticsearch/reference/6.4/search.html#search-adaptive-replica) would help here? It would however require that you upgrade...

As far as I know there is no way to control this in earlier versions.

---

<div class="post-metadata">

**Author:** ![ebuildy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ebuildy/32/6070_2.png) [@ebuildy](https://discuss.elastic.co/u/ebuildy)\
**Post date:** [October 24, 2018, 9:32am UTC](https://discuss.elastic.co/t/stop-routing-search-when-the-node-is-gc/153757/6 "2018-10-24T09:32:34Z")

</div>

what I called "balance" is how the client node performs the shard search (if I understood how search is working ^^ APP --\> CLIENT(index) --\> DATA(shards))

---

<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:** [November 21, 2018, 9:37am UTC](https://discuss.elastic.co/t/stop-routing-search-when-the-node-is-gc/153757/7 "2018-11-21T09:37:12Z")

</div>

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