Docker Community Forums

Share and learn in the Docker community.

Modyfy the parameters of a docker swarm node

Hello , I have a system based on the following settings :

docker swarm , 1 node.

sudo docker node ls

ID HOSTNAME STATUS AVAILABILITY MANAGER STATUS ENGINE VERSION
6nwth4ffptz68gnkoj84qtlr1 * smartcity Ready Active Leader 19.03.4

sudo docker node inspect 6nwth4ffptz68gnkoj84qtlr1 --pretty
ID: 6nwth4ffptz68gnkoj84qtlr1
Hostname: smartcity
Joined at: 2019-10-31 11:28:50.119252467 +0000 utc
Status:
State: Ready
Availability: Active
Address: 5.35.200.167
Manager Status:
Address: 5.35.200.167:2377
Raft Status: Reachable
Leader: Yes
Platform:
Operating System: linux
Architecture: x86_64
Resources:
CPUs: 4
Memory: 8.073GiB
Plugins:
Log: awslogs, fluentd, gcplogs, gelf, journald, json-file, local, logentries, splunk, syslog
Network: bridge, host, ipvlan, macvlan, null, overlay
Volume: local
Engine Version: 19.03.4
TLS Info:

I have the following problem : I would like to increase the docker swarm memory of the node and I have not found any method. Any Idea ?
Thanks
Gorka

What is docker swarm memory? Docker should be able use all available memory - regardless wether it runs in standalone or swarm mode. On all my swarm nodes, the reported total memory in docker info | grep Memory matches the memory reported in free -h.

When I execute free -h I have the following result:
root@smartcity:/home/sistemasfiware# free -h
total used free shared buff/cache available
Mem: 8,6G 7,3G 135M 24M 1,2G 1,0G
Swap: 3,8G 70M 3,7G

What I mean is that I would like to increase the Mem Value assigned (Memory value of a docker node to a higher value ). How could I do that ?
Thanks
Gorka

Just out of curiousity, how much ram do you think you are missing?

The problem that I have is that I am working in a Jhipster system which enters information in a MongoDB Docker.
In a specific moment I have the following problem :unable to create new native thread and Ihave read that one of the possible solutions wa to increase RAM memory to the maximum.
Regards
Gorka

You never bothered to share your docker-compose.yml or and other relevant information about the container at hand. If you didn’t specifcly declare resource constraints for cpu and ram, then docker will use all available ram.

If you realy look for advise, you will need to share your docker-compose.yml AND the Dockerfile you use to create the image AND the entrypoint script and all the scripts it calls between containerstart and start of your main process. Additionaly i will require the output of java --version to understand which version you are using. Also I need to know the exact JAVA_OPTS that are used. Java11 is the first version that actualy respects the CGROUP limits of the Container. Older Java versions (8-10) got the functionaliy backported.

Hello , the parameters of java are the following:

Java 1.8

Java options :
_JAVA_OPTIONS=-Xmx512m -Xms128m

The .yml files I attached are the following : smartcity.yml.txt and Fiware.yml.txt

Regards and thanks in advance

This is not the output i asked for! Funny how people suddenly become experts and are able to judge what grade of detail would be enough. There was a reason for that… please google jdk8 in containers to figure out the reason yourself.

-Xmx defines the maximum heap size, -Xms defines the minimum heap size. So if memory is your conerns, then set -Xmx to -Xmx1024m or -Xmx2048m. Though, normaly those settings are set to JAVA_OPTS. I guess the entrypoint script of the image appends _JAVA_OPTIONS to JAVA_OPTS.

Your problem is not a docker problem. It is a problem how your jHippster application is configured in the container. You might want to take this issue to the jHippster community.