Skip to content
This repository has been archived by the owner on Apr 12, 2022. It is now read-only.

setting memory parameters - docs correct? #151

Closed
davidkarlsen opened this issue Feb 23, 2018 · 5 comments
Closed

setting memory parameters - docs correct? #151

davidkarlsen opened this issue Feb 23, 2018 · 5 comments

Comments

@davidkarlsen
Copy link

  • Docker image used: 6.2.2 from elastic.inc
  • Operating System: RHEL 7.4

The docs https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html
say to set - "ES_JAVA_OPTS=-Xms512m -Xmx512m"

which I do:

elasticsearch:
    image: fsdepot.evry.com:8085/davidkarlsen/elasticsearchhq:6.2.2
    restart: always
    volumes:
      - /srv/elasticsearch/data:/usr/share/elasticsearch/data
      - /srv/elasticsearch/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml
      - /etc/localtime:/etc/localtime:ro
    environment:
      - bootstrap.memory_lock=true
      - "ES_JAVA_OPTS=-Xms12g -Xmx12g"
      - SERVICE_TAGS=prom_monitored,metrics_path=/_prometheus/metrics
      - SERVICE_NAME=applog-elasticsearch
      - SERVICE_CHECK_HTTP=/
    ulimits:
      memlock:
        soft: -1
        hard: -1
      nofile:
        soft: 65536
        hard: 65536
    mem_limit: 24g
    ports:
     - "0.0.0.0:9200:9200"
    cap_add:
      - IPC_LOCK

but as you see:

!ps
ps xa|grep elast|grep Xmx
26753 ?        SLsl  23:17 /usr/lib/jvm/jre-1.8.0-openjdk/bin/java -Xms1g -Xmx1g -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+AlwaysPreTouch -Xss1m -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djna.nosys=true -XX:-OmitStackTraceInFastThrow -Dio.netty.noUnsafe=true -Dio.netty.noKeySetOptimization=true -Dio.netty.recycler.maxCapacityPerThread=0 -Dlog4j.shutdownHookEnabled=false -Dlog4j2.disable.jmx=true -Djava.io.tmpdir=/tmp/elasticsearch.yVP7xQoF -XX:+HeapDumpOnOutOfMemoryError -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintTenuringDistribution -XX:+PrintGCApplicationStoppedTime -Xloggc:logs/gc.log -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=32 -XX:GCLogFileSize=64m -Des.cgroups.hierarchy.override=/ -Xms12g -Xmx12g -Des.path.home=/usr/share/elasticsearch -Des.path.conf=/usr/share/elasticsearch/config -cp /usr/share/elasticsearch/lib/* org.elasticsearch.bootstrap.Elasticsearch -Ebootstrap.memory_lock=true

it is confusing as it says -Xms1g -Xmx1g as well as -Xms12g -Xmx12g

@jurek7
Copy link

jurek7 commented Feb 23, 2018

I spotted the same issue. ES_JAVA_OPTS doesn't work anymore.
Changing values via jvm.options file works correctly.

@dliappis
Copy link
Contributor

The option is working as expected. The actual heap size should be checked from the ES API endpoint ; all the gory details can be found in #22 (comment). Since this a frequently asked question it could warrant a clarification in an faq section in the docs.

@dliappis
Copy link
Contributor

Also related to #43 (comment)

@davidkarlsen
Copy link
Author

Yes, the heapsizing works just fine - what I am reporting a bug on is the sizing of the young generation which leads to the excessive gc.

@davidkarlsen
Copy link
Author

davidkarlsen commented Apr 12, 2018

Oh, sorry - that was #155 - and yes, this issue #151 can be closed - it looks strange, but works ok.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants