# JVM for logstash

**URL:** <https://discuss.elastic.co/t/jvm-for-logstash/340424>\
**Category:** Logstash\
**Created:** [August 9, 2023, 7:02am UTC](https://discuss.elastic.co/t/jvm-for-logstash/340424 "2023-08-09T07:02:37Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![yuswanul](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yuswanul/32/101662_2.png) [@yuswanul](https://discuss.elastic.co/u/yuswanul)\
**Post date:** [August 9, 2023, 7:02am UTC](https://discuss.elastic.co/t/jvm-for-logstash/340424/1 "2023-08-09T07:02:37Z")

</div>

Hi there,

just want to confirm, is there any limit for JVM for logstash? if the JVM limit for elastic is 30 - 32 GB, does it also apply for logstash?

Thanks

---

<div class="post-metadata">

**Author:** ![Wolfram\_Haussig](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wolfram_haussig/32/70528_2.png) [@Wolfram\_Haussig](https://discuss.elastic.co/u/Wolfram_Haussig)\
**Post date:** [August 9, 2023, 7:43am UTC](https://discuss.elastic.co/t/jvm-for-logstash/340424/2 "2023-08-09T07:43:07Z")

</div>

Hi,

You can checkout the docs for Logstash here: [JVM settings | Logstash Reference [8.11] | Elastic](https://www.elastic.co/guide/en/logstash/current/jvm-settings.html)

> - The recommended heap size for typical ingestion scenarios should be no less than 4GB and no more than 8GB.

Best regards  
Wolfram

---

<div class="post-metadata">

**Author:** ![yuswanul](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yuswanul/32/101662_2.png) [@yuswanul](https://discuss.elastic.co/u/yuswanul)\
**Post date:** [August 9, 2023, 7:55am UTC](https://discuss.elastic.co/t/jvm-for-logstash/340424/3 "2023-08-09T07:55:21Z")

</div>

ok, thank you. I'll check it

---

<div class="post-metadata">

**Author:** ![yuswanul](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yuswanul/32/101662_2.png) [@yuswanul](https://discuss.elastic.co/u/yuswanul)\
**Post date:** [August 9, 2023, 8:18am UTC](https://discuss.elastic.co/t/jvm-for-logstash/340424/4 "2023-08-09T08:18:44Z")

</div>

but do you know the ideal value for the JVM? For example in elastic, the ideal value is 30G(max) to make sure that the elastic node uses compressed OOPS and if you set more than that, it will cause some problems.

does logstash have the same condition as that too?

if I followed this point, does it mean if I have a logstash server that has 128Gb memory, does that mean I can configure JVM to 64 - 96 GB?

> Do not increase the heap size past the amount of physical memory. Some memory must be left to run the OS and other processes. As a general guideline for most installations, don’t exceed 50-75% of physical memory. The more memory you have, the higher percentage you can use.

Thanks

---

<div class="post-metadata">

**Author:** ![Wolfram\_Haussig](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wolfram_haussig/32/70528_2.png) [@Wolfram\_Haussig](https://discuss.elastic.co/u/Wolfram_Haussig)\
**Post date:** [August 9, 2023, 8:26am UTC](https://discuss.elastic.co/t/jvm-for-logstash/340424/5 "2023-08-09T08:26:15Z")

</div>

I don't think this is advisable as the documentation states:

> - The recommended heap size for typical ingestion scenarios should be no less than 4GB and no more than 8GB.

So you should check your memory usage carefully and increase it in small steps if necessary. But this depends on your requirements so I cannot really give recommandations here (we are currently using 4GB in production).

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [August 9, 2023, 12:48pm UTC](https://discuss.elastic.co/t/jvm-for-logstash/340424/6 "2023-08-09T12:48:48Z")

</div>

> [@yuswanul](#):
>
> if I followed this point, does it mean if I have a logstash server that has 128Gb memory, does that mean I can configure JVM to 64 - 96 GB?

Logstash is more CPU bound than memory bound, the memory is used for the queue in memory (per default), inflight events and some other things like translate filter dictionaries.

You should follow the recommendation in the documentation, start with `4 GB` and increase if needed until `8 GB`.

I doubt that more than `8 GB` will make any difference, but if for some reason you start getting issues with `8 GB` it would be better to scale out with more nodes than to scale up a big node.

---

<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:** [September 6, 2023, 12:49pm UTC](https://discuss.elastic.co/t/jvm-for-logstash/340424/7 "2023-09-06T12:49:33Z")

</div>

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