Very slow network performance of Docker containers with host's network

后端 未结 2 1558
北海茫月
北海茫月 2021-02-20 13:35

I\'m having a problem with sluggish network performance between Docker containers and host\'s network. I asked this question on the Docker\'s forum but have received no answers

相关标签:
2条回答
  • 2021-02-20 14:01

    Your problem sounds very similar to this open issue on the Docker for Mac repo. Unfortunately, there doesn't seem to be a known solution, but the discussion in there may be useful. My personal guess at the moment is that the bug lives near the hyperkit virtualization being used on Docker for Mac specifically.

    In my case, I was oddly able to bypass this issue by using a different physical router, but I have no idea why it worked. Sadly that's not really a 'solution' though.

    I hate that this isn't a great answer, but I wanted to at least share the discussion in the open issue. Good luck and keep us posted.

    0 讨论(0)
  • 2021-02-20 14:06

    I suspect the default allocation of memory and CPU for the containers might not be optimal for the kind of network performance you are trying to achieve.

    1. Investigate the utilization of resources within the containers using standard tools like top, htop, strace etc. Or you can use docker stat command when these instances are in peak operation $ docker stats node1 node2 CONTAINER CPU % MEM USAGE/LIMIT MEM % NET I/O node1 0.07% 796 KB/64 MB 1.21% 788 B/648 B node2 0.07% 2.746 MB/64 MB 4.29% 1.266 KB/648 B
    2. Then you might want to modify various resource allocation parameters available with docker run.

      1. EDIT: Another thing to check would be MTU of the actual system interface and the setting on the docker interfaces. Use --mtu=BYTES to set MTU of your docker values to match your system interface's MTU value
    0 讨论(0)
提交回复
热议问题