WSL icon indicating copy to clipboard operation
WSL copied to clipboard

Very slow network speed on WSL2

Open carl-berg opened this issue 5 years ago • 410 comments

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 or git 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.

carl-berg avatar Feb 16 '20 14:02 carl-berg

Screencap speedtest-cli as a starting point.

$ sudo apt install speedtest-cli
$ speedtest-cli
[...]

image

therealkenc avatar Feb 16 '20 20:02 therealkenc

Okies, here's speedtest on windows, in the browser: Speedtest_win

...and here's speedtest from wsl2: Wpeedtest_wsl2

carl-berg avatar Feb 17 '20 07:02 carl-berg

Same here. Especially upload speed was drastically reduced - 36.61 -> 3.85 Mbit/s

acirulis avatar Feb 17 '20 11:02 acirulis

Hi, same here. My download was drastrically reduced of 200Mbit/s to 2 Mbit/s. Is there a solution?

guilhermehrcosta avatar Mar 01 '20 23:03 guilhermehrcosta

I'm hitting this issue, as well. Very frustrating.

AndrewGaspar avatar Mar 07 '20 23:03 AndrewGaspar

I'm seeing same issue. Speedtest-cli in bash: image

speedtest in Windows: image

kennethnipper avatar Mar 11 '20 17:03 kennethnipper

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 WSL Ubuntu Ver. 2 I have down = ~80 Mbit/s & up = ~4 Mbit/s. The upload is still about only 1/10 of the actual limit, but the download is up-to-standard now.

Also, the command speedtest is ~15 Mbit/s faster (download) than speedtest-cli for me.

Old comment: Windows network faster than WSL Ubuntu Ver. 1 which faster than WSL Ubuntu Ver. 2 here:

  1. Windows Ookla on Web browser down ~88 Mbit/s up ~38 Mbit/s
  2. WSL Ubuntu Ver. 1 speedtest-cli down ~32 Mbit/s up ~4 Mbit/s
  3. WSL Ubuntu Ver. 2 speedtest-cli down ~3 Mbit/s up ~4 Mbit/s

Cheers

tin-liu avatar Mar 14 '20 08:03 tin-liu

After follow this blog My network/file access improve more than 5 times speed.

PoldarnKJ avatar Mar 14 '20 09:03 PoldarnKJ

Same here, really annoying. Disabling AV (defender) doesn't helps image

rducom avatar Apr 08 '20 13:04 rducom

Same here. Getting about 7Mbit/s on WSL2 and 30+ in Windows.

Disabling Defender also made no difference for me either.

markgaze avatar May 03 '20 16:05 markgaze

Same here : Windows and WSL :

  • Up 261mb/s
  • Down 248mb/s

WSL 2 :

  • Up 1.60mb/s
  • Down 0.08mb/s

Vildevil avatar May 15 '20 08:05 Vildevil

Oddly, I'm getting decent results from the speedtest-cli, but things such as apt update are extremely slow, that is, less than a MB/s, where I'm used to seeing 30-40MB/s on my standard Ubuntu systems...

Speedtest results...

Retrieving speedtest.net configuration...
Testing from Verizon Fios (108.28.56.14)...
Retrieving speedtest.net server list...
Selecting best server based on ping...
Hosted by QTS Data Centers (Dulles, VA) [5.59 km]: 27.576 ms
Testing download speed................................................................................
Download: 427.07 Mbit/s
Testing upload speed......................................................................................................
Upload: 85.70 Mbit/s

apt update results

Get:1 http://security.ubuntu.com/ubuntu focal-security InRelease [107 kB]
Hit:2 http://archive.ubuntu.com/ubuntu focal InRelease
Get:3 http://archive.ubuntu.com/ubuntu focal-updates InRelease [107 kB]
Get:4 http://archive.ubuntu.com/ubuntu focal-backports InRelease [98.3 kB]
Get:5 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages [94.0 kB]
Get:6 http://archive.ubuntu.com/ubuntu focal-updates/universe amd64 Packages [30.5 kB]
Fetched 437 kB in 2s (197 kB/s)

copeland3300 avatar May 15 '20 20:05 copeland3300

Same issue here, dire network speed in WSL2. Performance with Linux or WSL is fine.

oliver-dungey avatar May 21 '20 13:05 oliver-dungey

I am experiencing the same

Speedteswt from WSL are poor compared to CMD

1

aleled avatar May 30 '20 10:05 aleled

Same here, Windows is about 60Mbps vs WSL2 14kbps !!!!

mrorat avatar May 30 '20 18:05 mrorat

I think it's useful to let people know that this doesn't happen to everyone, I'm getting my full speed here in WSL 2 on Windows 10 2004 (non Insider) image

arthurgeron avatar Jun 01 '20 13:06 arthurgeron

Much more interesting for me!

On windows image

Over on my freshly intalled WSL2 image

Seems like download speed remained rather intact, however upload was heavily hit.

Windows 10 Enterprise version 2004, Ubuntu 18.04 LTS`

didinele avatar Jun 02 '20 14:06 didinele

I'm seeing 249.94mbps down / 15.42mpbs up on Windows, which is pretty much what I expect from my ISP. On WSL2, sppedtest-cli shows 4.69mbps down / 3.29mbps up.

But apt and git performance in WSL2 is so much worse. I'm getting download speeds of 4–16 kbps on both.

~I don't recall measuring network speed on WSL1, but such terrible performance would have been quickly noticed.~ Edit: Just installed a WSL1 Ubuntu 20.04 LTS and I got 193.61 mbps down / 16.94 mbps up.

I'm on Windows 10 Enterprise version 2004 (build 19041.264) and Ubuntu 18.04 LTS that I recently upgraded to WSL2.

rarora7777 avatar Jun 03 '20 19:06 rarora7777

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:

speedtest-cli
Retrieving speedtest.net configuration...
Testing from AllTele (XX.XX.XX.XXX)...
Retrieving speedtest.net server list...
Selecting best server based on ping...
Hosted by A3 Allmänna IT - och Telekomaktiebolaget (Stockholm) [162.45 km]: 12.928 ms
Testing download speed................................................................................
Download: 124.83 Mbit/s
Testing upload speed......................................................................................................
Upload: 122.34 Mbit/s

BeErikk avatar Jun 04 '20 16:06 BeErikk

I was having a similar issue and found that switching from Wifi to Ethernet helped. I don't really understand why, as speedtests over my Wifi are fine outside of WSL2. I suppose it's possible that the Ethernet driver is somehow interacting with WSL and/or HyperV better.

Ethernet NIC is a "Killer E2500 Gigabit" WiFi is a "Killer Wireless n/a/ac 1535" (though the only thing it seemed to "Kill" was my network performance 😄)

JennToo avatar Jun 05 '20 21:06 JennToo

Hello friends, I'm not good at English, But me too I faced the same issue and I tried so many time and finally I got one solution and here's the url: https://www.hitxp.com/articles/software/ubuntu-fix-slow-wireless-internet-connection-speed-upgrading-11-04-natty-narwhal/. With sample pic

Screenshot from 2020-06-09 22-05-31

dvsmaxv avatar Jun 09 '20 16:06 dvsmaxv

don't have the problem on surface pro x (arm64)

matze19999 avatar Jun 10 '20 09:06 matze19999

It gets better... my speedtest today (Ethernet): WSL2: Download: 45.98 Mbit/s Upload: 3.39 Mbit/s

Windows: Download: 46.5 Mbit/s Upload: 17.8 Mbit/s

mrorat avatar Jun 10 '20 10:06 mrorat

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 Build: 19041.264 Ubuntu: 18.04.4

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.

https://www.youtube.com/watch?v=9Q5Ors94lJM

takizo avatar Jun 10 '20 12:06 takizo

Hello friends, I'm not good at English, But me too I faced the same issue and I tried so many time and finally I got one solution and here's the url: https://www.hitxp.com/articles/software/ubuntu-fix-slow-wireless-internet-connection-speed-upgrading-11-04-natty-narwhal/. With sample pic

Screenshot from 2020-06-09 22-05-31

I've tried made changes on nsswitch and even change resolve.conf to 1.1.1.1 and 8.8.8.8. It doesn't help either.

takizo avatar Jun 10 '20 12:06 takizo

Hello microsoft!!! do something or tell as how to speed it up :(

pankerit avatar Jun 16 '20 13:06 pankerit

Any clue how to solve this? I am lost

0xTimepunk avatar Jun 17 '20 20:06 0xTimepunk

@takizo Mine was already set to that without any modifications. I have 0.82Mbit/s when running speedtest for download, and weirdly 21.57 Mbit/s for upload. It's unuseable.

elmaynard avatar Jun 19 '20 23:06 elmaynard

+1

erfantkerfan avatar Jun 23 '20 09:06 erfantkerfan

set virtualization on from bios settings

paulikappi avatar Jun 24 '20 17:06 paulikappi