-
Notifications
You must be signed in to change notification settings - Fork 821
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Very slow network speed on WSL2 #4901
Comments
Same here. Especially upload speed was drastically reduced - 36.61 -> 3.85 Mbit/s |
Hi, same here. My download was drastrically reduced of 200Mbit/s to 2 Mbit/s. Is there a solution? |
I'm hitting this issue, as well. Very frustrating. |
Edit: After several reboots and adding the related folders as exceptions in Windows Defender as @jituanlin 's referred blog pointed out, and then tried removing the exceptions because I wanted to check which folder exception actually helped (so eventually theoretically equivalent to reboots-only, but who knows?), now in Also, the command Old comment:
Cheers |
After follow this blog |
Same here. Getting about 7Mbit/s on WSL2 and 30+ in Windows. Disabling Defender also made no difference for me either. |
Same here :
WSL 2 :
|
Oddly, I'm getting decent results from the Speedtest results...
|
Same issue here, dire network speed in WSL2. Performance with Linux or WSL is fine. |
Same here, Windows is about 60Mbps vs WSL2 14kbps !!!! |
I'm seeing 249.94mbps down / 15.42mpbs up on Windows, which is pretty much what I expect from my ISP. On WSL2, But
I'm on |
Just FYI. I have experienced extremely slow network speed as well, but it seems to be a temporary issue. Perhaps a local network issue? Right now in WSL 1 (2004 not insider) I get:
|
I was having a similar issue and found that switching from Wifi to Ethernet helped. Ethernet NIC is a "Killer E2500 Gigabit" |
Hello friends, |
don't have the problem on surface pro x (arm64) |
It gets better... my speedtest today (Ethernet): Windows: |
Hi all, I got the latest Windows 10 ver 2004 update. Switching from WSL1 to WSL2. I have the similar slow issue like you all had. But not particularly on the internet, it's more on Windows to Ubuntu via localhost access Windows Version: 2004 I run php development in WSL with Ubuntu 18.04.4, I have apache2, php7.2 and MariaDB running very well on WSL1 During development, I usually tunnel to my server to load ElasticSearch/Postgresql data, the tunnel is listen on localhost with respective port numbers. I do not have connection problem when running in WSL1, the speed is tremendous fast. It's fast like the data is loading on my machine itself. But when I switch to WSL2, I notice the connection is extremely slow. The initial loading took like 5-7 secs. Then the page would rendered. The hostname is mapped to 127.0.0.1, I've tried mapped on WSL2 Ubuntu private IP, the results are the same - Slow. I've capture the video and sharing with you all. Here is the video running on WSL1 https://www.youtube.com/watch?v=tNFtUUd2sG4 What I did was wsl --set-version Ubuntu 2, to upgrade the current Ubuntu distro to WSL2. Here is the video of the same development site running on WSL 2 (Please look at left bottom status bar) https://www.youtube.com/watch?v=JFYgzMHf2RU I've tried the comments on this thread, no luck getting it load fast like WSL 1. Hopefully this can be fixed, I've switched back to WSL1 and the speed is back to normal. You may refer to the video below, the result is instance. |
Interestingly -- GUI apps (at least, google-chrome) don't seem to be restricted. google-chrome I can hit 1.1gbps at fast dot com. at speedtest dot net, 900mbps. through speedtest-cli, max 250-300mbps. Make it make sense, please. :D |
This worked for me |
This should be the accepted answer. |
.... because if resetting the nameserver works for you, then probably your dns is misconfigured in windows. but also, dns is irrelevant to this problem. |
About this issue, I faced it as well when using the mirrored mode, but not when using NAT. So why in my case? Then mirrored mode came into place, and damn, was weird, but after while it made, mirrored is supposed to share the same IP/interface, meaning also same DNS, but I was using a static config and preventing WSL from automatically updating it. I've tested setting my nameserver to my local router, and worked like a charm and as expected. So to wrap up, to add to the checklist, verify if:
Hope it helps other lost souls out there |
If you have bridged connections with the WSL adapter and your WIFI adapter, it will also slow down. I had to delete the bridge adapter. |
so... i think we might have a flaw in speedtest apps. Speedtest cli consistently gets 300mbps or less for me, while speedtest in browser consistently is punching 900mbps now. Also, Docker Desktop has an absolute speedcap of 100mbps, it seems. |
I had very slow upload speeds on WSL2 and figured out that my problem was with my wifi adapter being used as an External Network on Hyper-V Virtual Switches. I just deleted the switch and got full upload speed again. |
I previously have the experimental
Temporary disable More permanent solution would be setting up Dev Drive and have WSL2 on Dev Drive (I don't know how to do that at the moment), probably need to wait for microsoft/devhome#748 |
This also fixed slow WSL2 downloads for me. |
Since the latest WSL2 update, I'm pulling in 400-500mbps pretty consistently. However, in Windows, I'm pulling 2Gbps. I'm also no longer throttled to 100mbps total in docker-desktop |
this one work for me, thank u |
Thank you very much, it helped. One question though, how did you find it ? Is it mentioned in docs or smth ? |
This works well for me. |
I see this problem, too. None of the suggestions mentioned above directly solves my problem, but it give me a right direction. In my case, my PC is installed an enterprise IT management software, it installed a virtual network adaptor, which supports higher network throughput than windows provided default, but it doesn't work well with WSL. So I just disable the feature, then problem solved. |
Holy $#*! I had updated host to use 1.1.1.1 but saw no difference. Didn't think about updating the DNS for Ubuntu itself, as I subconsciously presumed it would use the host's config for some reason. PSA: Just editing /etc/resolv.conf won't last since it usually gets overwritten on reboot, so you'll need to look into the proper way to permanently set your DNS depending on what distro and network manager and all that jazz. |
I was able to solve the issue on my WSL (opensuse) by editing the /etc/resolv.conf file. I replaced the default nameserever with 8.8.8.8 and it fixed my issues. As you can see after updating /etc/resolv.conf the speed increased I don't really get why it spped up the troughput besides the lookup time, but i'm not sure how speedtest works under the hood. |
Since 2.3.12, i am pulling 500mbps on command line linux apps, and upwards of 2.0gbps on X11 apps. Makes no sense. Both using the same speedtest servers. But it's much faster than the 100mbps cap that I had in previous versions. Still capped to 100mbps or less in Docker based WSL apps though |
this worked for me:
works after reboot aswell, since its permanent changes |
This worked for me, thanks! In my case I was connected via cable so the adapter name was "Ethernet". |
When using When using
in wsl cd /dev/shm/
dd if=/dev/zero of=file bs=1M count=500
python3 -m http.server 3000 in win wget http://127.0.0.1:3000/file -O NUL
--2024-08-26 21:17:51-- http://127.0.0.1:3000/file
Connecting to 127.0.0.1:3000... connected.
HTTP request sent, awaiting response... 200 OK
Length: 524288000 (500M) [application/octet-stream]
Saving to: 'NUL'
NUL 100%[=================================================>] 500.00M 937MB/s in 0.5s
2024-08-26 21:17:51 (937 MB/s) - 'NUL' saved [524288000/524288000]
wget http://172.27.83.126:3000/file -O NUL
--2024-08-26 21:18:08-- http://172.27.83.126:3000/file
Connecting to 172.27.83.126:3000... connected.
HTTP request sent, awaiting response... 200 OK
Length: 524288000 (500M) [application/octet-stream]
Saving to: 'NUL'
NUL 0%[ ] 2.84M 403KB/s eta 20m 1s After reinstalling the system, the speed returned to normal |
This worked for me too, just made sure to set it for the correct adapter which in my case was "Wi-Fi" |
If you're experiencing slow download speeds in WSL2, you can add custom DNS servers to the Step 1: Disable Automatic
|
speed test from windows: 1.5gbps make it make sense please |
This has also improved my download speed. |
.wslconfig
Raised the speed from 1mbps to 80mbps, and random timeouts to DNS are gone. |
Another thing I found is this issue reproducible when I'm connected to WiFi. On Ethernet/USB Hotspot, the speed is similar in both WSL and Windows. My work laptop has the issue, but I thought that could be because of security applications pre-installed, so they must be interfering with WSL. Turns out that using Ethernet works flawless. Maybe something wrong with WiFi and WSL network bridge driver. Not sure. |
Unfortunately, it changed nothing on my side... |
Windows build number:
10.0.19041.84
Dist: Ubuntu 18.04 LTS
I just installed WSL2 on my home computer for the first time and something i notice that i don't see on my work computer is that WSL2 has dramatically lower network speed (
wget
orgit clone
tested). Speeds on WSL seem to be about 10-20 kb/s wheras windows download speed seem to be correlating to my ISP spec of 100/10 Mbps or above.The text was updated successfully, but these errors were encountered: