Setting Logstash LS_JAVA_OPTS in docker not reflecting in container

Hi All,

I hope that this is an easy one and something that i am doing wrong in my compose file to easily fix it.

But basically in my compose file for logstash i am setting the environment value to LS_JAVA_OPTS

  logstash:
    image: bluemountain.azurecr.io/elastic.logstash
    build:
      context: .
      dockerfile: src/Configuration/Elastic/logstash/Dockerfile
    environment:
      - "LS_JAVA_OPTS=-Xmx2g -Xms2g"
    ports:
      - "5001:5001"
      - "9600:9600"
    configs:
      - source: logstash_pipline_config
        target: /usr/share/logstash/pipeline/logstash.conf
      - source: logstash_config
        target: /usr/share/logstash/config/logstash.yml
    depends_on: 
      - "elasticsearch"
    deploy:
      restart_policy:
        condition: on-failure

In portainer i can see this value reflected to "2g" in the below image

But when the container starts - these values are not passed in

any help would be greatly appricated as my LS container runs out of memory very quickly and takes 5 hours to import 61m rows of data (i am hoping that this will speed up the import of data)

Thanks
Joe.

That does not mean it is not getting passed. The -Xms1g -Xmx1g will be coming from /etc/logstash/jvm.options. If I set LS_JAVA_OPTS to -Xmx2g then my command line becomes

/bin/java -Xms500m -Xmx500m -XX:ParallelGCThreads=1[...] -Xmx2G -cp [...]

and the last value for -Xmx wins.

1 Like

Thanks for this, spot on! I have found a much faster way of importing the data now - scrubbed logstash and am using NEST bulkall with .netcore app now

Thanks

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.