Skip to content
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

Accessing Linux files through \\wsl$ is unbearably slow #4220

Closed
glen-84 opened this issue Jun 23, 2019 · 7 comments
Closed

Accessing Linux files through \\wsl$ is unbearably slow #4220

glen-84 opened this issue Jun 23, 2019 · 7 comments

Comments

@glen-84
Copy link

glen-84 commented Jun 23, 2019

  • Your Windows build number: (Type ver at a Windows Command Prompt)

Microsoft Windows [Version 10.0.18362.175]

  • What you're doing and what's happening: (Copy&paste the full set of specific command-line steps necessary to reproduce the behavior, and their output. Include screen shots if that helps demonstrate the problem.)

Accessing Linux files via \\wsl$\Ubuntu, and it's super slow.

I did some basic testing with dd, and found the following:

Write in //wsl$/Ubuntu...

dd if=/dev/zero of=//wsl$/Ubuntu/home/glen/testwrite.img bs=100M count=1 oflag=dsync

  • 104857600 bytes (105 MB, 100 MiB) copied, 18.186 s, 5.8 MB/s
  • 104857600 bytes (105 MB, 100 MiB) copied, 17.8413 s, 5.9 MB/s

MCAFEE REMOVED:

  • 104857600 bytes (105 MB, 100 MiB) copied, 16.1272 s, 6.5 MB/s
  • 104857600 bytes (105 MB, 100 MiB) copied, 15.9704 s, 6.6 MB/s

dd if=/dev/zero of=//wsl$/Ubuntu/home/glen/testlatency.img bs=512 count=1000 oflag=dsync

  • 512000 bytes (512 kB, 500 KiB) copied, 3.53898 s, 145 kB/s
  • 512000 bytes (512 kB, 500 KiB) copied, 0.335095 s, 1.5 MB/s
  • 512000 bytes (512 kB, 500 KiB) copied, 0.330495 s, 1.5 MB/s

Read in //wsl$/Ubuntu...

time dd if=//wsl$/Ubuntu/home/glen/testwrite.img of=/dev/null bs=8k

  • 104857600 bytes (105 MB, 100 MiB) copied, 14.9655 s, 7.0 MB/s

real 0m15.010s
user 0m0.078s
sys 0m0.265s

  • 104857600 bytes (105 MB, 100 MiB) copied, 4.20551 s, 24.9 MB/s

real 0m4.251s
user 0m0.031s
sys 0m0.124s

MCAFEE REMOVED

  • 104857600 bytes (105 MB, 100 MiB) copied, 3.71398 s, 28.2 MB/s

real 0m3.781s
user 0m0.046s
sys 0m0.125s

  • 104857600 bytes (105 MB, 100 MiB) copied, 3.64852 s, 28.7 MB/s

real 0m3.733s
user 0m0.030s
sys 0m0.140s


Write in ~...

dd if=/dev/zero of=/home/glen/testwrite.img bs=100M count=1 oflag=dsync

  • 104857600 bytes (105 MB, 100 MiB) copied, 0.390321 s, 269 MB/s
  • 104857600 bytes (105 MB, 100 MiB) copied, 0.371199 s, 282 MB/s

dd if=/dev/zero of=/home/glen/testlatency.img bs=512 count=1000 oflag=dsync

  • 512000 bytes (512 kB, 500 KiB) copied, 0.0086376 s, 59.3 MB/s
  • 512000 bytes (512 kB, 500 KiB) copied, 0.0088582 s, 57.8 MB/s
  • 512000 bytes (512 kB, 500 KiB) copied, 0.0082154 s, 62.3 MB/s

Read in ~...

time dd if=/home/glen/testwrite.img of=/dev/null bs=8k

  • 104857600 bytes (105 MB, 100 MiB) copied, 0.113269 s, 926 MB/s

real 0m0.128s
user 0m0.016s
sys 0m0.094s

  • 104857600 bytes (105 MB, 100 MiB) copied, 0.115235 s, 910 MB/s

real 0m0.132s
user 0m0.031s
sys 0m0.109s


Write in /mnt/c/Users/Glen... (from distro)

dd if=/dev/zero of=/mnt/c/Users/Glen/testwrite.img bs=100M count=1 oflag=dsync

  • 104857600 bytes (105 MB, 100 MiB) copied, 0.384083 s, 273 MB/s
  • 104857600 bytes (105 MB, 100 MiB) copied, 0.252227 s, 416 MB/s

dd if=/dev/zero of=/mnt/c/Users/Glen/testlatency.img bs=512 count=1000 oflag=dsync

  • 512000 bytes (512 kB, 500 KiB) copied, 0.0099631 s, 51.4 MB/s
  • 512000 bytes (512 kB, 500 KiB) copied, 0.0116009 s, 44.1 MB/s
  • 512000 bytes (512 kB, 500 KiB) copied, 0.0100696 s, 50.8 MB/s

Read in /mnt/c/Users/Glen... (from distro)

time dd if=/mnt/c/Users/Glen/testwrite.img of=/dev/null bs=8k

  • 104857600 bytes (105 MB, 100 MiB) copied, 0.11045 s, 949 MB/s

real 0m0.127s
user 0m0.000s
sys 0m0.125s

  • 104857600 bytes (105 MB, 100 MiB) copied, 0.109702 s, 956 MB/s

real 0m0.122s
user 0m0.000s
sys 0m0.125s


Write in /c/Users/Glen... (from Windows)

dd if=/dev/zero of=/c/Users/Glen/testwrite.img bs=100M count=1 oflag=dsync

  • 104857600 bytes (105 MB, 100 MiB) copied, 0.351462 s, 298 MB/s
  • 104857600 bytes (105 MB, 100 MiB) copied, 0.359245 s, 292 MB/s

dd if=/dev/zero of=/c/Users/Glen/testlatency.img bs=512 count=1000 oflag=dsync

  • 512000 bytes (512 kB, 500 KiB) copied, 0.112353 s, 4.6 MB/s
  • 512000 bytes (512 kB, 500 KiB) copied, 0.110369 s, 4.6 MB/s
  • 512000 bytes (512 kB, 500 KiB) copied, 0.113078 s, 4.5 MB/s

Read in /c/Users/Glen... (from Windows)

time dd if=/c/Users/Glen/testwrite.img of=/dev/null bs=8k

  • 104857600 bytes (105 MB, 100 MiB) copied, 0.0635338 s, 1.7 GB/s

real 0m0.105s
user 0m0.000s
sys 0m0.061s

  • 104857600 bytes (105 MB, 100 MiB) copied, 0.0628403 s, 1.7 GB/s

real 0m0.092s
user 0m0.015s
sys 0m0.046s

TL;DR:

\\wsl$\Ubuntu

  • Writing: ~6 MB/s !!!
  • Reading: ~28 MB/s !!!

/home/glen

  • Writing: ~275 MB/s
  • Reading: ~915 MB/s

/mnt/c/Users/Glen

  • Writing: ~300 MB/s
  • Reading: ~950 MB/s

/c/Users/Glen (from Windows)

  • Writing: ~295 MB/s
  • Reading: ~1.7 GB/s

😞

  • What's wrong / what should be happening instead:

It needs to be a lot faster in order to be useable.

  • Strace of the failing command, if applicable: (If some_command is failing, then run strace -o some_command.strace -f some_command some_args, and link the contents of some_command.strace in a gist here).

n/a

n/a

@therealkenc
Copy link
Collaborator

#4197

@glen-84
Copy link
Author

glen-84 commented Jun 24, 2019

@therealkenc That issue is about WSL2, and has nothing to do with \\wsl$.

@therealkenc
Copy link
Collaborator

One discussion thread for 9p perf, both directions, is plenty.

@glen-84
Copy link
Author

glen-84 commented Jun 24, 2019

@therealkenc Doesn't WSL2 have a completely different architecture (using a lightweight VM)? Are you suggesting that accessing \\wsl$ in WSL1 uses exactly the same set of technologies that are used when accessing /mnt/c in WSL2?

@benhillis
Copy link
Member

benhillis commented Jun 24, 2019

@glen-84 - Correct, \\wsl$ in WSL1 and WSL2 both use 9p. In WSL2 9p is also used for Windows drive access (/mnt/c etc).

@glen-84
Copy link
Author

glen-84 commented Jun 24, 2019

Okay, I apologize for the duplicate.

@eliecer2000
Copy link

This worked for me. for my WSL2 distro

wsl --set-version distro 1

it will take a few minutes

go back to version 2
wsl --set-version distro 2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants