Graylog heap size on Docker

Hi everyone,

I’m having some problems to run a separate docker container with graylog server an use a different amount of memory there, actually the maximum memory that it’s able to allocate is 1.9GB despite I’m not limiting the docker container.

I’ve tried a few environment variables to be passed while running docker-compose, but none of them allowed me to increase that amount of memory. For ES there’s no problem, I’ve limited the memory usage to the 80% on the server and if I check the ES cluster I can see that memory allocated.

Am I missing something else to allocate more memory for Graylog Server? I’ve read the advanced configuration topics, but none of them say something about docker, and /etc/default/graylog-server file doesn’t exist in the container, shall I create that one with the amount memory required?

Best regards.

What did you change exactly, what did you expect to happen and what did actually happen?

Good morning @jochen, I’ve applied the following environment variables to docker-compose file, in order to allocate more memory:


Also updated the file /usr/share/graylog/data/bin/graylogctl that makes reference to DEFAULT_JAVA_OPTS to boot with Max 1g and Min 1g, but no luck when restarting the container, as it doesn’t make any difference.

Do there’s any setting I’m missing?

Have a look at the current status of the node.

Best regards.

Have you tried simply giving the Docker container more memory?

Apart from that, you can override the JVM settings (i. e. the heap memory settings -Xms and -Xmx) with the GRAYLOG_SERVER_JAVA_OPTS environment variable.

You can see the default JVM options in the Dockerfile on GitHub:

Hi again @jochen, I tried that previously, but it doesn’t override the JVM settings, this is the line I used to override it:

GRAYLOG_SERVER_JAVA_OPTS "-XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap -XX:NewRatio=1 -XX:MaxMetaspaceSize=256m -server -XX:+ResizeTLAB -XX:+UseConcMarkSweepGC -XX:+CMSConcurrentMTEnabled -XX:+CMSClassUnloadingEnabled -XX:+UseParNewGC -XX:-OmitStackTraceInFastThrow **-Xms6g -Xmx6g**"

And this is the output I can see in the logs:

2017-09-22T10:02:19.960486876Z graylog_server.1.nr9bgmdccyr4@staging-graylog-manager-001    | Error: Could not find or load main class "-XX:+UnlockExperimentalVMOptions

In theory if that env is in dockerfile, I should be able to override it using these settings in my docker-compose.yml file. Do we have any other hints?

Best regards.

Which version of the Docker image are you using?

Hi again @jochen,

I’m using:

REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE    
graylog/graylog     2.3.1-1             20bb68539e8f        3 weeks ago         412MB

Best regards.

It looks like this is a bug in the Docker image:

Hi @jochen, sorry to hear that is a bug, but just in case you would like to have a look at, the variable - GRAYLOG_PASSWORD_SECRET, it’s also not overriden as I can see in the configuration file of graylog, as it’s keeping the same password as it was in the original configuration file.

Are you sure about that? Setting the environment variables will not change the configuration file inside the Docker container but simply override the value when running Graylog.

Well, if the variables are overriden in that way, then it’s OK, I misunderstood that they environment variables were actually overinding the configuration file in the server.

I can confirm the following works fine for me.

      GRAYLOG_SERVER_JAVA_OPTS: '-Xms3500m -Xmx3500m -XX:NewRatio=1 -XX:MaxMetaspaceSize=256m -server -XX:+ResizeTLAB -XX:+UseConcMarkSweepGC -XX:+CMSConcurrentMTEnabled -XX:+CMSClassUnloadingEnabled -XX:+UseParNewGC -XX:-OmitStackTraceInFastThrow'

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