# Elasticsearch rpm creates file /usr/lib/sysctl.d/elasticsearch.conf, but doesn't apply it, so vm.max\_map\_count remains the default until reboot

**URL:** <https://discuss.elastic.co/t/elasticsearch-rpm-creates-file-usr-lib-sysctl-d-elasticsearch-conf-but-doesnt-apply-it-so-vm-max-map-count-remains-the-default-until-reboot/20463>\
**Category:** Elasticsearch\
**Created:** [October 28, 2014, 2:53pm UTC](https://discuss.elastic.co/t/elasticsearch-rpm-creates-file-usr-lib-sysctl-d-elasticsearch-conf-but-doesnt-apply-it-so-vm-max-map-count-remains-the-default-until-reboot/20463 "2014-10-28T14:53:46Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Suny1](https://avatars.discourse-cdn.com/v4/letter/s/ecc23a/32.png) [@Suny1](https://discuss.elastic.co/u/Suny1)\
**Post date:** [October 28, 2014, 2:53pm UTC](https://discuss.elastic.co/t/elasticsearch-rpm-creates-file-usr-lib-sysctl-d-elasticsearch-conf-but-doesnt-apply-it-so-vm-max-map-count-remains-the-default-until-reboot/20463/1 "2014-10-28T14:53:46Z")

</div>

Hi. We checked our elasticsearch and OS settings, and found that the system  
parameter vm.max\_map\_count was too low. It was still the linux  
default, 65530, but should be increased to 262144. This value is set in  
/usr/lib/sysctl.d/elasticsearch.conf (and also in  
/etc/sysconfig/elasticsearch, MAX\_MAP\_COUNT=262144). But we have to call  
"sysctl -p /usr/lib/sysctl.d/elasticsearch.conf" for this to take effect,  
or reboot the server. I don't know if anything speaks against doing stuff  
like this in the rpm's install scripts. If it's OK, please add it. This was  
the behaviour on RHEL6 and CentOS6 with the  
rpms elasticsearch.noarch 1.2.1-1 and probably also 1.0.1.

--  
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/521c23f0-5f2c-4479-b224-34f4542f1291%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/521c23f0-5f2c-4479-b224-34f4542f1291%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [October 28, 2014, 3:14pm UTC](https://discuss.elastic.co/t/elasticsearch-rpm-creates-file-usr-lib-sysctl-d-elasticsearch-conf-but-doesnt-apply-it-so-vm-max-map-count-remains-the-default-until-reboot/20463/2 "2014-10-28T15:14:01Z")

</div>

This is a kernel parameter and requires a reboot.

It is bad habit to enforce kernel parameter change from an application.  
This is due to the administrator.

Note that increasing vm.max\_map\_count is only required for applications  
that use many small mmap calls (with mlockall, Elasticsearch does not). A  
number which is too high will potentially increase memory consumption on  
the server and reduce performance.

Jörg

On Tue, Oct 28, 2014 at 3:53 PM, Suny [suny.kim@gmx.net](mailto:suny.kim@gmx.net) wrote:

> Hi. We checked our elasticsearch and OS settings, and found that the  
> system parameter vm.max\_map\_count was too low. It was still the linux  
> default, 65530, but should be increased to 262144. This value is set in  
> /usr/lib/sysctl.d/elasticsearch.conf (and also in  
> /etc/sysconfig/elasticsearch, MAX\_MAP\_COUNT=262144). But we have to call  
> "sysctl -p /usr/lib/sysctl.d/elasticsearch.conf" for this to take effect,  
> or reboot the server. I don't know if anything speaks against doing stuff  
> like this in the rpm's install scripts. If it's OK, please add it. This was  
> the behaviour on RHEL6 and CentOS6 with the  
> rpms elasticsearch.noarch 1.2.1-1 and probably also 1.0.1.
> 
> --  
> 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/521c23f0-5f2c-4479-b224-34f4542f1291%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/521c23f0-5f2c-4479-b224-34f4542f1291%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/521c23f0-5f2c-4479-b224-34f4542f1291%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/521c23f0-5f2c-4479-b224-34f4542f1291%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/CAKdsXoHmyO3QJwakrDMH950pbDevsdbGdNQ86Zzf0k6Ysa9SLQ%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAKdsXoHmyO3QJwakrDMH950pbDevsdbGdNQ86Zzf0k6Ysa9SLQ%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Suny1](https://avatars.discourse-cdn.com/v4/letter/s/ecc23a/32.png) [@Suny1](https://discuss.elastic.co/u/Suny1)\
**Post date:** [October 28, 2014, 3:46pm UTC](https://discuss.elastic.co/t/elasticsearch-rpm-creates-file-usr-lib-sysctl-d-elasticsearch-conf-but-doesnt-apply-it-so-vm-max-map-count-remains-the-default-until-reboot/20463/3 "2014-10-28T15:46:35Z")

</div>

Thanks Jörg, your answer is really helpful. I didn't know of the connection  
between mlockall and max\_map\_count. I agree that the system parameters are  
the sys ads' job. Still, some documentation on this setting from  
elasticsearch.org would help, like in which cases it's important, as you  
explained. BTW, i'm using your post  
[http://jprante.github.io/2012/11/28/Elasticsearch-Java-Virtual-Machine-settings-explained.html](http://jprante.github.io/2012/11/28/Elasticsearch-Java-Virtual-Machine-settings-explained.html)  
a lot.

--  
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/ac09e37f-d603-46ca-a499-7fa542e86b06%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/ac09e37f-d603-46ca-a499-7fa542e86b06%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Suny1](https://avatars.discourse-cdn.com/v4/letter/s/ecc23a/32.png) [@Suny1](https://discuss.elastic.co/u/Suny1)\
**Post date:** [October 28, 2014, 4:30pm UTC](https://discuss.elastic.co/t/elasticsearch-rpm-creates-file-usr-lib-sysctl-d-elasticsearch-conf-but-doesnt-apply-it-so-vm-max-map-count-remains-the-default-until-reboot/20463/4 "2014-10-28T16:30:20Z")

</div>

Unfortunately, the rpms puts its file into the wrong directory. In RHEL,  
the sysctl reads /etc/sysctl.d, not /usr/lib/sysctl.d/.

--  
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/8c69f6e1-2b23-474a-957a-3cc7bfbd1d55%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/8c69f6e1-2b23-474a-957a-3cc7bfbd1d55%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Suny1](https://avatars.discourse-cdn.com/v4/letter/s/ecc23a/32.png) [@Suny1](https://discuss.elastic.co/u/Suny1)\
**Post date:** [October 28, 2014, 5:52pm UTC](https://discuss.elastic.co/t/elasticsearch-rpm-creates-file-usr-lib-sysctl-d-elasticsearch-conf-but-doesnt-apply-it-so-vm-max-map-count-remains-the-default-until-reboot/20463/5 "2014-10-28T17:52:45Z")

</div>

Wait. I'd say it doesn't require a reboot in RHEL6, it's a tunable  
parameter because it sits in /proc/sys/vm/max\_map\_count. In fact, it is  
activated at service start in the init script  
sysctl -q -w vm.max\_map\_count=$MAX\_MAP\_COUNT  
So I'd say things are fine once the service has started. That  
/usr/lib/sysctl.d/elasticsearch.conf doesn't mean a thing on RHEL6, the  
MAX\_MAP\_COUNT in /etc/sysconfig/elasticsearch counts. I apologize for the  
confusion. It was on a customer's server, and i wasn't aware that  
elasticsearch wasn't running when he queried the system parameters. For my  
part, learned sth again.

--  
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/ba7bece3-8b61-474a-9e42-b6d5e7e8a216%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/ba7bece3-8b61-474a-9e42-b6d5e7e8a216%40googlegroups.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, 12:53am UTC](https://discuss.elastic.co/t/elasticsearch-rpm-creates-file-usr-lib-sysctl-d-elasticsearch-conf-but-doesnt-apply-it-so-vm-max-map-count-remains-the-default-until-reboot/20463/6 "2017-07-06T00:53:22Z")

</div>


