How to assess why git clone/fetch is so slow inside Hyper-V Server?

Solution 1:

The fact that you can clone at 15 MBs from the gitlab VM makes this most likely a problem with the network abstraction layer of the hypervisor.


  • Test if all network connections are slow by sending raw data between 2 linux VMs.

    On secondary linux VM run:

    nc -v -l -p 4321 > /dev/null
    

    On the gitlab VM run:

    dd if=/dev/zero bs=1024K count=512 | nc -v $IP_OF_FIRST_MACHINE -p 4321
    

    This will show your network speed. Most likely this will be slow

  • Turn off VMQ on the hypervisor

  • Try turning off jumbo frames (MTU > 1500)

  • Lastly, try doing a tcp dump from wireshark inside of the gitlab vm. See if there are errors that jump out

Solution 2:

Check your DNS settings/servers. I had this issue and found out it was caused by my primary dns not resolving the git server. Once I switched my primary it sped up. Appears that git doesn't allow caching of DNS queries and therefore had to failover every time.