Docker Compose Datanode and JVM Heap
I've tried a million suggestions to get the JVM heap for the datanode to be more that 1gb.
Data Node Heap Size Warning
(triggered 2 days ago)
There are data node nodes in the cluster which could potentially run with a higher configured heap size for better performance.
Data node datanode only has 1 GB Java Heap assigned, out of a total of 17 GB RAM.
Currently, there is 15 GB free memory available on the node. We recommend to make an additional half of this available to the Java Heap.
Note: For production performance, it is recommended to configure this node to use 8 GB Java Heap (50% of RAM).
The Java Heap can be configured using the opensearch_heap configuration parameter in the node's configuration file (datanode.conf).
Can I get a clear solution to allow for this setting and remediating the above warning?
Would like to know this as well.
Have the datanode.conf mapped via docker-compose.yml to /etc/graylog/datanode/datanode.conf with the option "opensearch_heap" in it, but it looks like this setting has no effect on the heap of the datanode container.
Nevermind. Managed to get it working.
Setting the "opensearch_heap" in the datanode.conf file mapped via docker volumes to /etc/graylog/datanode/datanode.conf works.
What was the problem at least for me is the permissions.
Graylog datanode in the container runs as UID:999 and GID:999 setting these on the config file resolved my issue.
Hi,
It works with JAVA_OPTS
environment:
JAVA_OPTS: "-Xmx10g -Xmx10g"
JAVA_OPTS is used as parameter when starting the data-node inside the container
https://github.com/Graylog2/graylog2-server/blob/cea75cf77d645c28c8b9a8f6e092c447c5246de6/data-node/bin/graylog-datanode.sh#L28
I'm running into the same - I've searched and found multiple suggestions, but nothing from the compose file seems to actually affect the heap size.
What is strange is I have added GRAYLOG_DATANODE_OPENSEARCH_HEAP: "7g" under environment for my datanode and I see in the datanode container logs that it looks to have actually picked it up INFO [OpensearchProcessImpl] [2025-11-06T20:06:10,471][INFO ][o.o.e.NodeEnvironment ] [datanode] heap size [7gb], compressed ordinary object pointers [true], but the Graylog GUI still shows the warning.
Is this as simple as the warning doesn't auto dismiss? I dismissed the warning and it has not come back after restart.
It looks to me that graylog probably checks the command line parametr for the warning. I had 10Gb as JAVA_OPTS, but i still got the same reminder. After i did a bind mount of /etc/graylog/datanode/jvm.options https://github.com/Graylog2/graylog2-server/blob/master/data-node/config/jvm.options, and modified the values in this file, i have not got any reminders anymore.