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.
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.
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.
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
a lot.
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.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant logo are trademarks of the Apache Software Foundation in the United States and/or other countries.