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?
Good morning @jochen, I’ve applied the following environment variables to docker-compose file, in order to allocate more memory:
GRAYLOG_DEFAULT_JAVA_OPTS=""
GRAYLOG_SERVER_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.
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:
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?
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.