-
Notifications
You must be signed in to change notification settings - Fork 817
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
Significant performance issue on manually mounted NTFS partition #6985
Comments
@suxpert: Thanks for sharing this. Given that the wsl --mount drive is an hdd, It's expected that it's slower that your SSD host drive (there's a also a IO penalty since you're accessing it from a VM). When writing to drvfs a bunch of caches are in play on both the host and the guest so if you're benchmarking I'd recommend writing much bigger files (> 10GB). |
@OneBlue I agree with you that HDD should be slower than SSD, but I don't think writing speed at 54MB/s for HDD is acceptable, even if it is mounted on VM. So I disagree to close this issue and said that this is My computer have 32GB memory, so I tried a much larger file (~50GB) in case of cache, here is the result:
Yes, slower than the previous 5GB test, but is still much faster than manually mounting with I also noticed that in task manager, activite time is about 90% almost all the time with drvfs, but is clumbing up and down, from 0% to 60% and then 0% again and again when manually mounted, so this must be an issue, but not a feature that is |
@suxpert There are multiple things that are causing this different numbers: the underlying medias [HDD vs SSD], the cost of passing through the disk to the WSL2 (via SCSI), and the ntfs driver that you're using (most likely ntfs-3g). I can't say for sure which of those are the most impactful but it's not something that we can change from a WSL perspective since WSL2 is accessing the disk using the hyper-V disk passthrough driver. I suspect that accessing a lot of small files might be faster with |
Windows Build Number
Microsoft Windows [Version 10.0.21387.1]
WSL Version
Kernel Version
5.10.16
Distro Version
Kali rolling 2021.1
Other Software
No response
Repro Steps
In #6984 I've reported that it failed to mount NTFS partition using
wsl --mount
, but I can mount the partition manually with two steps:wsl --mount \\.\PHYSICALDRIVE0 --bare
in PowerShellsudo mount -t ntfs /dev/sdc2 /mount_point
I do this because it has been reported that file IO between windows and WSL (drvfs) is much slower than it should be, so I thought mount the whole disk in wsl might improve performance.
But during my test using
dd
, the performance of this manually mounted NTFS is far worth than drvfs.Expected Behavior
I thought that mounting a physical disk directly in WSL should achieve at least the same performance compared with drvfs, if not better. Because in this way, WSL can directly access the disk without transforming though
9p
.Actual Behavior
First I've tried
dd
to shared memory, everything seems OK:$ dd if=/dev/zero of=/run/shm/largefile bs=1M count=5000
Then WSL filesystem (vhdx files on SSD), the first run is slower than the second run (after I delete the file)
$ dd if=/dev/zero of=/tmp/largefile bs=1M count=5000
$ dd if=/dev/zero of=$HOME/largefile bs=1M count=5000
For mounted drivers (drvfs), the performance was still acceptable on the SSD side:
$ dd if=/dev/zero of=/mnt/c/largefile bs=1M count=5000
Where
/mnt/c
is auto mounted in WSL:But for HDD, the speed is much lower:
$ dd if=/dev/zero of=/mnt/d/largefile bs=1M count=5000
Where
/mnt/d
is also auto mounted in WSL:Last, the manually mounted NTFS partition (the same
D:\
driver), mounted via:C:\> wsl --mount \\.PHYSICALDRIVE0 --bare
$ sudo mount -t ntfs /dev/sdc2 /tmp/disk
and resulting:
Performance
$ dd if=/dev/zero of=/tmp/disk/largefile bs=1M count=5000
Diagnostic Logs
No response
The text was updated successfully, but these errors were encountered: