# JVM Pressure on Cluster Nodes with too many indices

**URL:** <https://discuss.elastic.co/t/jvm-pressure-on-cluster-nodes-with-too-many-indices/310695>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-monitoring\
**Created:** [July 26, 2022, 11:05pm UTC](https://discuss.elastic.co/t/jvm-pressure-on-cluster-nodes-with-too-many-indices/310695 "2022-07-26T23:05:25Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![saelastic](https://avatars.discourse-cdn.com/v4/letter/s/34f0e0/32.png) [@saelastic](https://discuss.elastic.co/u/saelastic)\
**Post date:** [July 26, 2022, 11:05pm UTC](https://discuss.elastic.co/t/jvm-pressure-on-cluster-nodes-with-too-many-indices/310695/1 "2022-07-26T23:05:25Z")

</div>

My current ES stack(7.17.4) deployment size is  
2 nodes across 2 zones with 240 GB disk and 8 GB RAM with 2 CPU's each.  
I have about 4000 shards present in total in the cluster.

> This count put the ES hot/data nodes in ES to an unhealthy state with _JVM Pressure_. **My disk space was barely used(10% approx per node).**

Each index has exactly 1 - primary shard and 1-replica shard

I could recover and restore the cluster to healthy state only after deleting the unused indices. Could some one explain this behavior on limitations about creating too many indices per cluster per node ?

On monitoring, a better way to identify these issues before , any metrics from elastic cloud to keep an eye on ?

---

<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:** [July 27, 2022, 1:06am UTC](https://discuss.elastic.co/t/jvm-pressure-on-cluster-nodes-with-too-many-indices/310695/2 "2022-07-27T01:06:40Z")

</div>

Which version of Elasticsearch are you using? I would recommend reading [the following blog post on the topic](https://www.elastic.co/blog/how-many-shards-should-i-have-in-my-elasticsearch-cluster).

---

<div class="post-metadata">

**Author:** ![saelastic](https://avatars.discourse-cdn.com/v4/letter/s/34f0e0/32.png) [@saelastic](https://discuss.elastic.co/u/saelastic)\
**Post date:** [July 27, 2022, 4:24pm UTC](https://discuss.elastic.co/t/jvm-pressure-on-cluster-nodes-with-too-many-indices/310695/3 "2022-07-27T16:24:05Z")

</div>

Hello @Christian_Dahlqvist Thank you for sharing the doc.

> After reading the document, As in this scenario only the number of indices (not size/num. of primary shards) was creating the problem, I can infer that my cluster state was too large to handle in the JVM heap space. (Correct me if I'm wrong)

I have autoscaling enabled , I wonder why this was failing to scale . Any thoughts ?

---

<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:** [July 27, 2022, 4:36pm UTC](https://discuss.elastic.co/t/jvm-pressure-on-cluster-nodes-with-too-many-indices/310695/4 "2022-07-27T16:36:23Z")

</div>

It looks like you have far too many small shards given the version you are using, which is inefficient. I am not familiar with how autoscaling works so can not help there.

---

<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:** [August 24, 2022, 4:37pm UTC](https://discuss.elastic.co/t/jvm-pressure-on-cluster-nodes-with-too-many-indices/310695/5 "2022-08-24T16:37:00Z")

</div>

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