WSL: WSL2 git is slow from gitlab
Environment
Windows build number: [Version 10.0.19041.804]
Your Distribution version: [Ubuntu 20.04]
Whether the issue is on WSL 2 and/or WSL 1: [Linux version 4.19.128-microsoft-standard (oe-user@oe-host) (gcc version 8.2.0 (GCC)) #1 SMP Tue Jun 23 12:58:10 UTC 2020]
Steps to reproduce
- Launch Ubuntu for WSL2
- Install and run speed test: https://www.speedtest.net/apps/cli
- Attempt to clone a git repository within the
\\wsl$\Ubuntu\home\<user>directory - Observe that gits reported network performance is far under the systems available network performance
Expected behavior
Git clones the repository in a timely manner with reasonable network speeds for the network you are on
Actual behavior
Git takes extremely long to finish the clone command and is operating well below the network thresholds.
This issue is is the worst when running git operations on repositories that are located on Gitlab (all repositories, private, public, etc). When interacting with Gitlab I see speeds <= ~80 KiB/s. When checking out from Github I see speeds >= 1 MiB/s. When interacting with either Gitlab or Github using windows git.exe commands I see speeds >= 20 MiB/s. I have also ran a speed test on my WSL2 Ubuntu instance via the command line tool and am getting ~200 Mbpsdownload and~20 Mbpsupload. Furthermore, all of my repositories are within\wsl$\Ubuntu\home\golkedj` and therefore should not be experiences I/O performance issues based on what I have read in this thread and other threads.
I am convinced that this issue only recently starting presenting itself because I have been interacting with this repository for several months with this exact same WSL2 Ubuntu instance and have noticed no issues at all until recently when I was unable to do anything with this repository within a reasonable amount of time. For example when I first set up this WSL2 Ubuntu instance I cloned this repository without issue, but now a fresh clone of it is taking several hours to complete (I have not actually been able to wait long enough for it to complete successfully).
I currently worked around this issue by using wsl.exe after modifying the core.autocrlf setting to input but this is not a feasible workaround due to the number of repositories I work with daily and the need to be able to run the WSL2 git command for them for consistency.
Performance details:
- Gitlab clone with WSL Ubuntu’s
gitcommand:Receiving objects: 16% (553/3435), 268.01 KiB | 34.00 KiB/s
- Github clone with WSL Ubuntu’s
gitcommand:Receiving objects: 100% (1034/1034), 487.62 KiB | 4.31 MiB/s, done.
- speed test results: https://www.speedtest.net/result/c/1b45ae1f-41ba-4e32-bea2-bc283632ccdf
- Gitlab clone with Windows
git.execommand:Receiving objects: 100% (3435/3435), 903.49 MiB | 19.56 MiB/s, done.
- Github clone with Windows
git.execommand:Receiving objects: 100% (434/434), 7.43 MiB | 13.19 MiB/s, done.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 20 (2 by maintainers)
I had a similar issue with git performance under wsl2 and browsing other issues stumbled upon #6585.
I replace the default /etc/resolve.conf with
And after this my “git pull” was pretty fast again. The problem was that resolving names the did not exist seems to be problematic when there is a VPN connection hanging around…
We have a fix for this incoming, but in the meantime this should get things working:
sudo ifconfig eth0 mtu 1350 upIt works for me. also remember to follow this comment https://github.com/microsoft/WSL/issues/5420#issuecomment-646479747 to prevent wsl overwriting your
resolve.conffileHi. Whats about fix?
sudo ifconfig eth0 mtu 1350 updoesn’t worked for me 😦For me I do not think it is a network issue as mentioned in #4901. I ran a speed test via WSL and the speed test CLI and that gave me extremely good numbers. Something else is going on here like throttling for specific things and/or slowdown due to I/O performance. I provided the speed test results in the issue description.
sudo apt install net-toolsforifconfig. Forip(viaiproute2package), it looks like:Okay, thanks. So presumably it is slow into
/anywhere.On a lark, total WAG experiment, try: