Performance

MTU

Id

Reference

License

1

https://linuxhint.com/how-to-change-mtu-size-in-linux/

unknown

2

https://unix.stackexchange.com/a/466981

CC BY-SA 4.0 1

3

https://wiki.archlinux.org/title/sysctl#Enable_MTU_probing

GNU Free Documentation License 1.3 or later 2

Increasing the MTU value can, in some cases, improve network efficiency.

Warning

Changing the MTU value could have unintended consequences!

GNU/Linux

Run as user

root

You can change the default Ethernet (IEEE 802.3) MTU value from 1500 to 9000 if all devices you want to use support it (including dumb Ethernet switches).

If you use the networking systemd service provided by Debian there are various possibilities. Once you done the configuration you can check it with ICMP requests like these

ping ${other_host_using_mtu_9000} -s 8972 -Mdo
  1. append the mtu line to the interface configuration file

    /etc/network/interfaces
    1# [ ... ]
    2
    3auto eth0
    4iface eth0 inet static
    5    # [ ... ]
    6    mtu 9000
    7
    8# [ ... ]
    
  1. reboot

  2. optionally enable MTU probing. See reference 3

    echo "net.ipv4.tcp_mtu_probing = 1" >> /etc/sysctl.conf
    sysctl -p /etc/sysctl.conf
    exit
    

Docker

Id

Reference

License

4

https://www.civo.com/learn/fixing-networking-for-docker

unknown

5

https://discourse.drone.io/t/docker-mtu-problem/1207

unknown

6

https://sylwit.medium.com/how-we-spent-a-full-day-figuring-out-a-mtu-issue-with-docker-4d81fdfe2caf

unknown

Run as user

root

  1. add this setting to the daemon configuration file

    /etc/docker/daemon.json
    1{
    2    "mtu": 9000
    3}
    
  2. restart the service

    systemctl restart docker
    
  3. add a new network with the new MTU value in the Docker compose file

    services:
        myservice_0:
            # [ ... ]
            networks:
                - mynetwork
    
        myservice_1:
            # [ ... ]
            networks:
                - mynetwork
    
        # [ ... ]
    
         myservice_n:
            # [ ... ]
            networks:
                - mynetwork
    
    # [ ... ]
    
    networks:
        mynetwork:
          driver: bridge
          driver_opts:
            com.docker.network.driver.mtu: 9000
    

Footnotes

1

Copyright (c) 2018 Mr Shunz (at unix.stackexchange.com)

2

Copyright (c) ArchWiki contributors