docker / for-win

Bug reports for Docker Desktop for Windows
https://www.docker.com/products/docker#/windows
1.86k stars 291 forks source link

Network slowdown to external db #13092

Open txdFrancesco opened 1 year ago

txdFrancesco commented 1 year ago

Actual behavior

From version v4.13.0 of Docker Desktop, communication with mysql database is 10 times slower (default Laravel config)

Expected behavior

No performance changes

Information

I'm using a docker container for development while using a remote mysql database. After updating Docker Desktop to version 4.13, the db connection is 10 time slower. Updating to later versions did nothing, while reverting to version 4.12 solved the issue. Docker Version avg time (100x) min time mat time
v4.12 avg: 0.0037034225463867 min: 0.0028238296508789 max: 0.040066957473755
v4.13 avg: 0.044582877159119 min: 0.0047309398651123 max: 0.046868085861206
v4.14.1 avg: 0.044747798442841 min: 0.0058379173278809 max: 0.048084020614624

The problem is not present in linux with the respective docker engine versions.

Steps to reproduce the behavior

  1. setup or retrieve credentials to a remote mysql. Fastest way is a Mysql container on a different machine.
  2. create a table on the database
  3. download attached file docker_perf_test.txt
  4. in the same folder, run the test command (passing the correct env variables)
    docker run -it --rm -v ${pwd}:/usr/src/myapp -e DB_TABLE_NAME=table_name -e DB_HOST=host -e DB_NAME=name -e DB_USER=user -e DB_PW=pw -w /usr/src/myapp php:7.4-cli ./docker_perf_test.txt

    The script will run 100 iteration of a "select * " query on the table, and measure the results.

rg9400 commented 1 year ago

I have noticed this in 4.13.0, 4.14.0, and 4.14.1. The issue exists even if you are hosting files on a CIFS network share...since 4.13.0 the network performance of remote files/data has degraded tremendously.

txdFabio commented 1 year ago

Tested today with docker desktop v4.15.0, issue persists, still x10 slower than 4.12...

txdFabio commented 1 year ago

Re-tested today with docker desktop v4.16.3, issue persists, still x10 slower than 4.12. Any hope to have this issue fixed?

txdFabio commented 1 year ago

Issue still persist on v4.17.0, any hope to have it addressed?

txdFrancesco commented 1 year ago

I found a difference in the behavior of the containers depending on the docker engine version which I think could be the culprit:

trying to execute the command traceroute -T www.google.it (or any other non-docker-network address) I get the following:

Docker 4.12: traceroute to www.google.it (216.58.209.35), 30 hops max, 60 byte packets 1 172.17.0.1 (172.17.0.1) 0.037 ms 0.015 ms 0.013 ms 2 216.58.209.35 (216.58.209.35) 24.059 ms 24.071 ms 24.064 ms

Docker >=4.13: traceroute to www.google.it (216.58.209.35), 30 hops max, 60 byte packets 1 172.17.0.1 (172.17.0.1) 0.420 ms 0.388 ms 0.374 ms 2 192.168.65.5 (192.168.65.5) 0.359 ms 0.328 ms 0.306 ms 3 216.58.209.35 (216.58.209.35) 22.633 ms 5.371 ms 5.323 ms

There seems to be an extra internal routing step in the new stack. I tried various combinations on network configurations but the difference persist. Any idea on how to skip that?

docker-robot[bot] commented 1 year ago

There hasn't been any activity on this issue for a long time. If the problem is still relevant, mark the issue as fresh with a /remove-lifecycle stale comment. If not, this issue will be closed in 30 days.

Prevent issues from auto-closing with a /lifecycle frozen comment.

/lifecycle stale