# JVM setting

**URL:** <https://discuss.elastic.co/t/jvm-setting/287954>\
**Category:** Elasticsearch\
**Created:** [October 28, 2021, 6:57pm UTC](https://discuss.elastic.co/t/jvm-setting/287954 "2021-10-28T18:57:43Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![elasticforme](https://avatars.discourse-cdn.com/v4/letter/e/f05b48/32.png) [@elasticforme](https://discuss.elastic.co/u/elasticforme)\
**Post date:** [October 28, 2021, 6:57pm UTC](https://discuss.elastic.co/t/jvm-setting/287954/1 "2021-10-28T18:57:43Z")

</div>

What should be prefer jvm option for cluster?  
using elasicsearch java  
three node x 100gig ram each, 20core each host

```auto
-Xms24g
-Xmx24g
-XX:+UseG1GC
-XX:G1ReservePercent=25
-XX:InitiatingHeapOccupancyPercent=30

```

or following which listed on oracle java document

```auto
-Xms24G
-Xmx24G  
-XX:+UseG1GC 
-XX:MaxGCPauseMillis=200 
-XX:ParallelGCThreads=20 
-XX:ConcGCThreads=5 
-XX:InitiatingHeapOccupancyPercent=70

```

data ingestion is about 800Million record a day of system metric via logstash  
nothing else running in this systems except Elasticsearch  
What other parameter needs to be set to make sure memory gets use properly and efficiently. I can test this out once I know something more.  
I am very naive on java part

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [October 28, 2021, 9:10pm UTC](https://discuss.elastic.co/t/jvm-setting/287954/2 "2021-10-28T21:10:56Z")

</div>

By default Elasticsearch configures itself according to the machine on which it's running so it's best not to override any of these settings yourself. 800M documents per day is ~10k per second which is nowhere near the throughput that [some benchmarks](https://elasticsearch-benchmarks.elastic.co/index.html#tracks/http-logs/nightly/default/30d) can achieve using the default settings, so you should be fine.

---

<div class="post-metadata">

**Author:** ![elasticforme](https://avatars.discourse-cdn.com/v4/letter/e/f05b48/32.png) [@elasticforme](https://discuss.elastic.co/u/elasticforme)\
**Post date:** [October 28, 2021, 11:22pm UTC](https://discuss.elastic.co/t/jvm-setting/287954/3 "2021-10-28T23:22:16Z")

</div>

David,  
so you saying does not matter what of above setting will not make much difference?

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [October 29, 2021, 7:01am UTC](https://discuss.elastic.co/t/jvm-setting/287954/4 "2021-10-29T07:01:27Z")

</div>

No, I think it matters if you override any of these settings, it can make performance a lot worse to get it wrong. So don't do that. Let Elasticsearch set these things for you.

---

<div class="post-metadata">

**Author:** ![elasticforme](https://avatars.discourse-cdn.com/v4/letter/e/f05b48/32.png) [@elasticforme](https://discuss.elastic.co/u/elasticforme)\
**Post date:** [October 29, 2021, 1:10pm UTC](https://discuss.elastic.co/t/jvm-setting/287954/5 "2021-10-29T13:10:05Z")

</div>

David you right.  
so far I have never had to touch that and it was working beautifully.  
but I have gone to Container/VM route and since then kibana dashboard loading is slow , very slow.  
even though I have gone from ssd to nvme.  
on host/vm level I can see the IO speed is more then four time, new system has faster cpu, network speed is also doubled.

hence I started playing around with jvm options.

---

<div class="post-metadata">

**Author:** ![elasticforme](https://avatars.discourse-cdn.com/v4/letter/e/f05b48/32.png) [@elasticforme](https://discuss.elastic.co/u/elasticforme)\
**Post date:** [November 9, 2021, 1:49am UTC](https://discuss.elastic.co/t/jvm-setting/287954/6 "2021-11-09T01:49:56Z")

</div>

which one is better performance. both are same cpu count / same memory

Node-1

-XX:+UseG1GC  
-XX:NewSize=6g  
-XX:MaxNewSize=6g  
-XX:SurvivorRatio=6  
-XX:TargetSurvivorRatio=70

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/d/f/dff403784f63385776de1e095d6358f7e7052438.png)

Node -2  
-XX:+UseG1GC  
-XX:G1ReservePercent=25  
-XX:InitiatingHeapOccupancyPercent=70  
-XX:ConcGCThreads=5  
-XX:ParallelGCThreads=10

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/6/d/6db3e47fe984481a0965962e16c41233f3667f08.png)

I am just playing around with what I can find. and trying to understand this java memory stuff.

---

<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:** [December 7, 2021, 1:50am UTC](https://discuss.elastic.co/t/jvm-setting/287954/7 "2021-12-07T01:50:34Z")

</div>

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