I would like to ask if there is a way to allow java to spawn its threads to multiple cores when I run a dockerized graylog image.
Expected Behavior
I would like to use a specific number of cores that are available in my systems.
Current Behavior
Right now java uses only 2 cores while there are 10 in each node. Docker can identify that there are 10 cores in the system.
Possible Solution
Any JAVA_OPTS flag that could enable that feature
Steps to Reproduce (for bugs)
Context
There is a huge amount of messages arriving in the graylog cluster and the cluster is unable to process them. I have tried to adjust the [input,output,process]buffer_processors but this didn’t help. I think that the worst thing is that there are available resources but java doesn’t use them. This results to a very huge load (like 20-22), 100% usage at the first 2 cores of the system and also to the filling up of the journal.
Graylog is also installed in a different cluster without using docker and I’m not encountering this issue. The java threads are using all the cores.
Which version of Docker are you using?
Which Docker image are you using?
What’s the complete configuration of the Docker container?
What’s the complete configuration of Graylog?
I have tried using the same JAVA_OPTS and using much simpler ones as well -Xms1g -Xmx4g -XX:+UnlockExperimentalVMOptions but it didnt work. Only 2 CPUs are used.
That’s not the default for the new Docker image and as long as you don’t provide the complete and unredacted value of GRAYLOG_SERVER_JAVA_OPTS you’re using, we won’t be able to help you.
What’s the complete output of the following command?
Please run the Docker image groovy:2.5.0-jre8 and post the output when executing the expression Runtime.runtime.availableProcessors().
Example:
$ docker run -it groovy:2.5.0-jre8
Jun 06, 2018 3:46:46 PM java.util.prefs.FileSystemPreferences$1 run
INFO: Created user preferences directory.
Groovy Shell (2.5.0, JVM: 1.8.0_171)
Type ':help' or ':h' for help.
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
groovy:000> Runtime.runtime.availableProcessors()
===> 4
groovy:000> :exit
Thanks for all the help. I have found the issue. It had to do with systemd and not with java or dockerd. It was my mistake. I changed the resources of the VMs but didn’t restart dockerd to refresh the cgroup limits.