-
Notifications
You must be signed in to change notification settings - Fork 822
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
Major performance (I/O?) issue in /mnt/* and in ~ (home) #873
Comments
with the current design of DrvFs, I guess this problem is hard to resolve. I recommend you to run a ssh server inside WSL and do the edit via ssh to bypass some other issues. from https://blogs.msdn.microsoft.com/wsl/2016/06/15/wsl-file-system-support/ |
Also @Mika56 the devs have said they are working on improving performance by redesigning parts of how file I/O works. That's probably why they haven't documented exactly how it works yet, since it is very much in flux at the moment. |
there is no supported way of editing WSL files I wonder how difficult it would be for popular IDE and text editors to become WSL aware and preserve the attribute of WSL files (the security model may have some inconsistencies but I might be ok with it) |
@ajaykagrawal Some text-editors have an ability to save in-place rather than overwrite. I heard someone say that they enabled that setting in one or another text editor and it worked. |
Thanks @fpqc. I don't quite know what save in-place means but I hope more editors are updated to have this ability |
@fcicq I'm using an IDE for a reason :) I need my IDE, and mounting a folder through SSH, FTP, SMB or whatever would be no improvement on my current environment |
@ajaykagrawal Basically instead of writing a new file and saving over it, the text editor has a delta and applies it to the file, at least that's my guess. |
In the old days, whenever you hit "save", text editors saved into your existing file. This was simple and efficient, but if your editor crashes or was killed mid-save, or if you run out of disk space, or if anything eelse weird happens, you might end up with a corrupt garbled mess that's half the old file and half the new file. Or it might just be completely empty / wipe out all of your data entirely, if your app implemented "save" with an initial truncate, which is easy to do by default on Linux at least. These days, text editors almost always "save" by creating a temporary file in the same directory, writing the entire new file contents to the temporary file, and then moving the temporary file on top of the old file, overwriting the old file in the process. "Move" within a directory is guaranteed in most cases to be strictly atomic -- even if your computer loses power mid-Move, you'll always be left with either the new file or the old file; not a corrupted intermediate. Clever, right? Saves lots of "I lost my data!" headaches. Thing is, if an application creates an arbitrary new file, there's no way for the OS to know that it's supposed to have the same magic permissions as some other existing file. That's what's breaking WSL. Some editors let you go back to the old-style behavior. Has more risk, but avoids issues in some situations. |
@aseering it looks like Windows move preserves those attribs, or at least robocopy does? |
Read more carefully: It does an excellent job of preserving the attributes of the wrong file :-) [EDIT] I can't speak for robocopy, just regular move, but what you want in this scenario is the opposite of what you want in most scenarios. |
@aseering yep I am aware. I just thought that Windows commandline tools preserve even hidden ntfs attributes (moving is different from editing a file, since the atomic operation is done at the filesystem level, I think) like robocopy does. |
@fpqc -- ah, I see what you're getting at. Yeah, applications can copy extended attributes, if they're programmed to do so correctly. |
Exactly the same "issue" detailed above, as I am as well a Symfony dev. My SF projects are all located into /mnt/d/.... my apache2 server (running on ubuntu bash) root folder is linked using a symlink and the perfs are aweful ... This also lead to some issue with Symfony cache system btw. |
I've not noticed any performance issues with my IDE IntelliJ/PHPStorm, but the execution of PHP/Symfony code (running LAMP/Symfony with SuluCMS installed) ist between 4-10 times slower (total execution time) than on a normal Ubuntu system ... Why is it so slow? If you can fix this issue, it will be the best environment for developing true DOT.NET and true PHP on Windows!!! |
Is this issue beeing worked on? |
@baroso Yep. It's one of their top priorities after getting all the web-programming stuff working. |
@fpqc Is there another issue to watch to see progress? Slow mount performance is the only thing holding me back from upgrading to Windows 10 and using WSL. |
@nickjj All I know is that the devs have said that it is a top priority, but they haven't released details on how they are going to pull it off. It did sound like they have an idea of how to do it though. |
Any updates on this? |
nope. Mum's the word on this'n. Major performance improvements I think are targeted for RS3 not RS2. |
What does RS3 mean in the grand scheme of things? Will it still make it into the next official big update? |
RS3 insiders builds will be rolling out probably in May. Release in December? |
Thanks. Guess I'll come back next year. Hopefully things are ironed out. Using the insider's build is out of the question for me due to the severe breach of privacy that it entails. |
@ajaykagrawal As a general rule of thumb, whenever the question "I wonder how difficult it would be" is asked, assume that the answer is "very, very difficult", and/or "takes an enormous amount of time with no guarantee of success" ;) In this case, imagine trying to get the owner of every application that opens and saves text files to modify their apps to support a different way of opening the files without read locks, and writing changes to those files without destroying extended properties managed by an external process. If the underlying issue was simple to solve, we'd likely have already solved it. However, yes, we are very aware of the issues and we do aim to work on improving Windows <--> Linux filesystem interop in the future. |
I realize this is a hard problem, but, just reporting that I'm still (build 15042) finding DrvFs to be much slower than Linux for my common use cases, to a degree that impacts my productivity somewhat. A good specific representative-example workload that I would like to see optimized is the Boost build process: http://www.boost.org/doc/libs/1_61_0/more/getting_started/unix-variants.html#easy-build-and-install The build steps should be heavily CPU-bound in the compiler; that's fine. But I would love to see the final Note that Boost's build system is cross-platform. And the final install command is just as slow under regular Windows :-) It would be wonderful if the Windows version got faster too. |
@aseering fwiw, the major performance improvements were not planned for RS2. Even 2 months ago the devs were saying it was planned for RS3. |
@fpqc -- yep, I'm just keeping the ticket alive :-) |
frustrating you know very well people on ordinary channels can't use WSL2 and rely on people who got on the faster tracks to give them some info |
@SvenGroot, thanks for your post and explanation. I left Windows for Linux around NT and now I'm back. You mentioned a workaround to move files off C: to D: so as to skip some of the filters causing slow downs. I symlink from C: into Ubuntu's root so I can use graphical editors without having to go full XWindows.
Given what is (and 2 years of experience), are there any other workarounds?
|
One idea I just had for WSL to have its own metadata cache, and to add a filter driver that invalidates the cache when necessary. |
@SvenGroot I thought Microsoft is making money solving hard problems (like amazing Github Copilot stuff and natural text-to-speech). Any progress on those items after 4 years? |
Just changing to a moderately large project directory (~20,000 files) on It's disappointing that this is still a big issue 7 years after the ticket was opened. |
@BrianHVB curious, while I don't use Windows anymore for development (macOS), does this happen with WSL2? |
@ylluminate Yes - it is specific to WSL 2. I haven't used WSL 1 in almost two years, but I never encountered the same performance issues (on the same 20,000 file repo). Putting the repo under WSL-Linux's virtual disk (e.g. in the |
Well, if you're onto workarounds, why don't you just install a Linux distro? |
@EmpiricEmpire Do you mean installing a Linux distribution under WSL 2? I have several, that is where this problem is originating. I want to operate on the project's source code using Windows-based GUI tools such as my JetBrain's IDEs, while compiling and running the project in Linux via WSL 2. |
Well, clearly you have a distro under a WSL 😄 I just googled and JetBrain produces Linux binaries of their IDE. But even if it wouldn't you could run it under WINE just fine performance-wise, so… 🤷 |
@BrianHVB sorry, don't get me wrong, I get you used to Windows and why would you switch, etc… Which is exactly why my first message started with "if you're onto workarounds". It's just that having a single repo might be easier, that's all 🤷 Not insisting tho, do whatever you like. |
A brief description
As a Symfony developer, it's always been hard to get a stable/fast development environment. My current setup is a Ubuntu running under VirtualBox (using vagrant). While page generation is fast, my IDE accesses my PHP files through SMB, which is really (sometimes horribly) slow.
I'm now trying to use WSL to improve all of this. However, I'm having a major performance issue when using
/mnt/*
folders.If I set up a Symfony project under
/mnt/c
, it is really slow. If I set it up under/home/mikael
, it is very fast.Expected results
Drives mounted under /mnt should be as fast a any other folder.
Actual results
With a new Symfony 3.1.3 project, under
/home/mikael
takes between 100ms and 130ms to generate the home page.The same project under
/mnt/c/
takes between 1200ms and 1500ms.Your Windows build number
10.0.14393.51
Steps / commands required to reproduce the error
Open your browser and go to http://127.0.0.1:8000/.
Once the page is loaded, refresh it (on first request, Symfony had to generate its cache).
Generation time is displayed on the bottom left
You can then do the same under
/mnt/c/
Additional information
I've added my dev folders as excluded folders in Windows Defender, as well as %LOCALAPPDATA%\lxss.
I've tried having my project in
~
and pointing my IDE to %LOCALAPPDATA%\lxss\home\mikael\ but as I've later read, there is no supported way of editing WSL files.WSL is installed in its default location under C (no strange junction or symlink), which is a healthy SSD.
My computer is attached to a domain, if this might have any influence.
The text was updated successfully, but these errors were encountered: