# ElasticSearch Memory settings

**URL:** <https://discuss.elastic.co/t/elasticsearch-memory-settings/18038>\
**Category:** Elasticsearch\
**Created:** [June 11, 2014, 9:22am UTC](https://discuss.elastic.co/t/elasticsearch-memory-settings/18038 "2014-06-11T09:22:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ciprian\_2](https://avatars.discourse-cdn.com/v4/letter/c/9dc877/32.png) [@Ciprian\_2](https://discuss.elastic.co/u/Ciprian_2)\
**Post date:** [June 11, 2014, 9:22am UTC](https://discuss.elastic.co/t/elasticsearch-memory-settings/18038/1 "2014-06-11T09:22:59Z")

</div>

Hi,

I'm a beginner in elasticsearch. I'm using also ubuntu for  
elasticsearch(version 1.1.0). My issue : where should I set the  
ES\_MIN/MAX\_SIZE(= ES\_HEAP\_SIZE)? In /etc/elasticsearch/elasticsearch.yml or  
/etc/default/elasticsearch or /etc/init.d/elasticsearch? From what i read i  
should set the ES\_MIN/MAX\_SIZE = ram / 2.  
My application is reading data from a Sqs and pushing it to elasticseach.  
This is done from 2 consumers each with a thread pool of 5 threads. That  
means 10 threads who are inserting documents in elasticsearch. I have a  
separate server for elasticsearch with 8gb of ram.  
From my configuration : I set ES\_MIN/MAX\_SIZE = 4g(=ram / 2) only in  
/etc/elasticsearch/elasticsearch.yml and restarting the elasticsearch. When  
I call the htop, I see for elasticsearch user the next command which is  
duplicated(..10 threads =\> more line like this one) :  
/usr/lib/jvm/java-7-openjdk-amd64//bin/java -Xms256m -Xmx1g -Xss256k  
-Djava.awt. Shouldn't it be -Xms2g -Xmx2g, because I set in  
elasticsearch.yml 2g?

1. From what i read in other posts I should set this in "service wrapper  
configuration". But which file is linked to "service wrapper configuration"  
/etc/default/elasticsearch or /etc/init.d/elasticsearch?
2. Should I have same values in elasticsearch.yml ES\_MIN\_MEM/ES\_MAX\_MEM  
like in "service wrapper configuration" (ES\_HEAP\_SIZE) ?

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/c4dcdd58-6f8e-46dd-afbb-a9ec940513e8%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/c4dcdd58-6f8e-46dd-afbb-a9ec940513e8%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:** [June 11, 2014, 9:43am UTC](https://discuss.elastic.co/t/elasticsearch-memory-settings/18038/2 "2014-06-11T09:43:39Z")

</div>

As per my other response - /etc/default/elasticsearch for ubuntu/debian

Regards,  
Mark Walkom

Infrastructure Engineer  
Campaign Monitor  
email: [markw@campaignmonitor.com](mailto:markw@campaignmonitor.com)  
web: [www.campaignmonitor.com](http://www.campaignmonitor.com)

On 11 June 2014 19:22, Ciprian [turcanciprian87@gmail.com](mailto:turcanciprian87@gmail.com) wrote:

> Hi,
> 
> I'm a beginner in elasticsearch. I'm using also ubuntu for  
> elasticsearch(version 1.1.0). My issue : where should I set the  
> ES\_MIN/MAX\_SIZE(= ES\_HEAP\_SIZE)? In /etc/elasticsearch/elasticsearch.yml or  
> /etc/default/elasticsearch or /etc/init.d/elasticsearch? From what i read i  
> should set the ES\_MIN/MAX\_SIZE = ram / 2.  
> My application is reading data from a Sqs and pushing it to elasticseach.  
> This is done from 2 consumers each with a thread pool of 5 threads. That  
> means 10 threads who are inserting documents in elasticsearch. I have a  
> separate server for elasticsearch with 8gb of ram.  
> From my configuration : I set ES\_MIN/MAX\_SIZE = 4g(=ram / 2) only in  
> /etc/elasticsearch/elasticsearch.yml and restarting the elasticsearch. When  
> I call the htop, I see for elasticsearch user the next command which is  
> duplicated(..10 threads =\> more line like this one) :  
> /usr/lib/jvm/java-7-openjdk-amd64//bin/java -Xms256m -Xmx1g -Xss256k  
> -Djava.awt. Shouldn't it be -Xms2g -Xmx2g, because I set in  
> elasticsearch.yml 2g?
> 
> 1. From what i read in other posts I should set this in "service wrapper  
> configuration". But which file is linked to "service wrapper configuration"  
> /etc/default/elasticsearch or /etc/init.d/elasticsearch?
> 2. Should I have same values in elasticsearch.yml ES\_MIN\_MEM/ES\_MAX\_MEM  
> like in "service wrapper configuration" (ES\_HEAP\_SIZE) ?
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/c4dcdd58-6f8e-46dd-afbb-a9ec940513e8%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/c4dcdd58-6f8e-46dd-afbb-a9ec940513e8%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/c4dcdd58-6f8e-46dd-afbb-a9ec940513e8%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/c4dcdd58-6f8e-46dd-afbb-a9ec940513e8%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAEM624a4ErfdhfGuV6Exjy37bT80ZGeusOKYedK%3D%3D90K\_xOZVQ%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAEM624a4ErfdhfGuV6Exjy37bT80ZGeusOKYedK%3D%3D90K_xOZVQ%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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 6, 2017, 1:23am UTC](https://discuss.elastic.co/t/elasticsearch-memory-settings/18038/3 "2017-07-06T01:23:21Z")

</div>


