I have production docker swarm with 9 stacks, most of them have volumes. Currently docker is running with single node.
I have to add second node and it is the place where problems started. Especially the problem is with portainer - it becomes very laggy, almost unusable. Also when I move some containers to a new node, my project seems to be completely stucked - the problem is in communication between containers on different nodes. Some requests are ok, but most of them seems to be broken.
After some research I found out that problem seems to be with MTU. MTU of eth1 is 1450 and the docker's default is 1500.
The question is, is it possible to change docker's MTU to 1450 on the fly?
I tried:
- Add key to dockerd --mtu=1450 - the docker service didn't start at all
- Change main network's mtu in docker-compose - seems that it didn't updated, I think that the network should be recreated
- Add mtu option to /etc/docker/daemon.json also seemed to be with no effect
How to change mtu on working production server? Possible downtime for 10-15 minutes is ok, but I don't want to remove all stacks and recreate them.
/lib/systemd/system/docker.service
" ... that will be overwritten on the next upgrade. Edit/etc/docker/daemon.json
with the contents{ "mtu": 1450 }
(or add to the existing contents of the file). – Caterina