Graylog JVM Heapsize on Docker-compose

Description of your problem

Hello,

I use docker-compose to install graylog. How can i increase Graylog JVM Memory

I tried to change in graylogctl at graylog_graylog_1 container


but still not work

did i missing something?

Hello && Welcome

Did you restart you service after configuring you file?

Perhaps take a look here

Hope that helps

Hi
i have restarted the container, but nothing has changed the jvm is not increasing, here’s my docker compose file

version: '2'
services:
  # MongoDB: https://hub.docker.com/_/mongo/
  mongodb:
    image: mongo:3
    volumes:
      - mongo_data:/data/db
    restart: always
    # Network Configuration
    networks:
       graylog_net:

  # Elasticsearch: https://www.elastic.co/guide/en/elasticsearch/reference/6.x/docker.html
  elasticsearch:
    image: docker.elastic.co/elasticsearch/elasticsearch-oss:6.8.10
    volumes:
      - es_data:/usr/share/elasticsearch/data
    environment:
      - http.host=0.0.0.0
      - transport.host=localhost
      - network.host=0.0.0.0
      - "ES_JAVA_OPTS=-Xms1g -Xmx1g"
    ulimits:
      memlock:
        soft: -1
        hard: -1
    mem_limit: 4g
    restart: always
    # Network configuration
    networks:
      graylog_net:

  # Graylog: https://hub.docker.com/r/graylog/graylog/
  graylog:
    image: graylog/graylog-enterprise:4.1.3
    volumes:
      - graylog_data:/usr/share/graylog/data
      - ./graylog/plugin/graylog-plugin-auth-sso-3.3.0.jar:/usr/share/graylog/plugin/graylog-plugin-auth-sso-3.3.0.jar
      - ./graylog/plugin/graylog-plugin-enterprise-3.3.7.jar:/usr/share/graylog/plugin/graylog-plugin-enterprise-3.3.7.jar
      - ./ssl:/usr/share/graylog/data/config/ssl:ro # Certificate web
      - ./ssl/cacerts:/usr/local/openjdk-8/lib/security/cacerts:ro # Certificate java
      - ./archive:/tmp/graylog-archive:rw #graylog archive file
      
    environment:
      # CHANGE ME (must be at least 16 characters)!
      # - GRAYLOG_PASSWORD_SECRET=somepasswordpepper
    # Password: admin
      - GRAYLOG_ROOT_PASSWORD_SHA2=8c6976e5b5410415bde908bd4dee15dfb167a9c873fc4bb8a81f6f2ab448a918
      - GRAYLOG_TRANSPORT_EMAIL_ENABLED=true
      - GRAYLOG_TRANSPORT_EMAIL_USE_AUTH=true
      - GRAYLOG_TRANSPORT_EMAIL_HOSTNAME=smtp.yandex.ru
      - GRAYLOG_TRANSPORT_EMAIL_PORT=465
      - GRAYLOG_TRANSPORT_EMAIL_USE_TLS=false
      - GRAYLOG_TRANSPORT_EMAIL_USE_SSL=true
      - GRAYLOG_TRANSPORT_EMAIL_AUTH_USERNAME=Somemail.com
      - GRAYLOG_TRASNPORT_EMAIL_AUTH_PASSWORD=somepassword
      - GRAYLOG_TRANSPORT_EMAIL_SUBJECT_PREFIX=[grayLog]
      - GRAYLOG_TRANSPORT_EMAIL_FROM_EMAIL=somemail.com
    # URL Configuration
      - GRAYLOG_HTTP_EXTERNAL_URI=https://<graylogserverip>:8443/
      - GRAYLOG_REST_TRANSPORT_URI=https://<graylogserverip>:8443/api
    # SSL Configuration
      - GRAYLOG_HTTP_ENABLE_TLS=true
      - GRAYLOG_HTTP_TLS_CERT_FILE=/usr/share/graylog/data/config/ssl/graylog-cert.pem
      - GRAYLOG_HTTP_TLS_KEY_FILE=/usr/share/graylog/data/config/ssl/graylog-key.pem
    links:
      - mongodb:mongo
      - elasticsearch
    depends_on:
      - mongodb
      - elasticsearch
    ports:
      # Graylog web interface and REST API
      - "<graylogserverip>:8443:9000"
      # Syslog TCP
      - "<graylogserverip>:5140:5140/tcp"
      # Syslog UDP
      - "<graylogserverip>:1514:1514/udp"
      # Mikrotik UDP
      - "<graylogserverip>:5142:5142/udp"
      # GELF TCP
      - "<graylogserverip>:12201:12201"
      # GELF UDP
      - "<graylogserverip>:12201:12201/udp"
      # Filebeat
      - "<graylogserverip>:5044:5044/tcp"

    restart: always

    # Network configuration for static IP
    networks:
      graylog_net:
        ipv4_address: 172.20.0.4
  
# Volumes for persisting data, see https://docs.docker.com/engine/admin/volumes/volumes/
volumes:
  mongo_data:
    driver: local
  es_data:
    driver: local
  graylog_data:
    driver: local

networks:
  graylog_net:
    driver: bridge
    ipam:
     config:
       - subnet: 172.20.0.0/16
         gateway: 172.20.0.1


Hey there, just like anything else when it comes to config options, this can be addressed by using an environment variable. The one for this would be GRAYLOG_SERVER_JAVA_OPTS. So, you could add this to your Docker compose file:

GRAYLOG_SERVER_JAVA_OPTS="-Xms4g -Xmx4g -XX:NewRatio=1 -server -XX:+ResizeTLAB -XX:-OmitStackTraceInFastThrow"

Try that and see if that addresses your issue.

1 Like

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