Hi guys,
I tried to setting ES_HEAP_SIZE to 1024m on my linux server. I used this setting > export ES_HEAP_SIZE=1024m. Now how to check if this new setting is work??
Thanks
Hi guys,
I tried to setting ES_HEAP_SIZE to 1024m on my linux server. I used this setting > export ES_HEAP_SIZE=1024m. Now how to check if this new setting is work??
Thanks
check echo $ES_HEAP_SIZE
set it in elasticsearch.yml of config file
What do you mean by setting es_heap_size on config file?? I read on the elasticsearch website that es_heap_size is an environment variable. and how to setting it to config file?? ES_HEAP_SIZE : 1024m like this??
Thanks
I tried to setting ES_HEAP_SIZE to 1024m on my linux server. I used this setting > export ES_HEAP_SIZE=1024m. Now how to check if this new setting is work??
Look at the resulting JVM process when you start ES, specifically the -Xmx option.
If you're starting ES as a service (which you should be doing) you should probably be modifying /etc/sysconfig/elasticsearch or /etc/default/elasticsearch instead.
Both Elasticsearch and the JVM provides some wonderful introspection tools, so there are many ways to check this.
/_nodes/stats/jvm
and for each node inspect the path jvm.mem.heap_max_in_bytes
. For example, if I start Elasticsearch with ES_HEAP_SIZE=4g
listening on localhost and then executecurl -sS -XGET localhost:9200/_nodes/stats/jvm | jq '..|.heap_max_in_bytes?|select(type != "null")'
I see
4225236992
curl -sS -XGET "localhost:9200/_cat/nodes?h=heap*&v"
which would give
heap.current heap.percent heap.max
119.9mb 2 3.9gb
with the same 4g heap.
on the console. If you have multiple nodes running, this will print out one line for each node.
ES_HEAP_SIZE=4g
and then executejps -l -m -v
then I see
5858 org.elasticsearch.bootstrap.eElasticsearche start -Xms4g -Xmx4g -Djava.awt.headless=true -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+HeapDumpOnOutOfMemoryError -XX:+DisableExplicitGC -Dfile.encoding=UTF-8 -Djna.nosys=true -Des.path.home=/Users/jason/elasticsearch/elasticsearch-2.1.0
jinfo
. For example:jinfo -flags 5858
gives
Attaching to process ID 5858, please wait...
Debugger attached successfully.
Server compiler detected.
JVM version is 25.66-b17
Non-default VM flags: -XX:CICompilerCount=4 -XX:CMSInitiatingOccupancyFraction=75 -XX:+DisableExplicitGC -XX:+HeapDumpOnOutOfMemoryError -XX:InitialHeapSize=4294967296 -XX:MaxHeapSize=4294967296 -XX:MaxNewSize=697892864 -XX:MaxTenuringThreshold=6 -XX:MinHeapDeltaBytes=196608 -XX:NewSize=697892864 -XX:OldPLABSize=16 -XX:OldSize=3597074432 -XX:+UseCMSInitiatingOccupancyOnly -XX:+UseCompressedClassPointers -XX:+UseCompressedOops -XX:+UseConcMarkSweepGC -XX:+UseFastUnorderedTimeStamps -XX:+UseParNewGC
Command line: -Xms4g -Xmx4g -Djava.awt.headless=true -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+HeapDumpOnOutOfMemoryError -XX:+DisableExplicitGC -Dfile.encoding=UTF-8 -Djna.nosys=true -Des.path.home=/Users/jason/elasticsearch/elasticsearch-2.1.0
Note the -XX:InitialHeapSize=4294967296 -XX:MaxHeapSize=4294967296
in the output.
There are many other ways to check this same information (JVisualVM, Java Mission Control, jstat
, jmap
, etc.).
That won't work though! See @magnusbaeck's response.
© 2020. All Rights Reserved - Elasticsearch
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.