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
All tools from shell are very slow #138
Comments
Are you using LDAP to connect to your computer? If yes, this is similarly related to this issue, but I'm not 100% sure. To test that you are facing the same issue, you could create a Information in this thread or on cygwin's nsswitch.conf could prove useful. Maybe others have a fairly simple cookbook to follow. |
I using Windows by logging in with domain user. I created /etc/passwd and /etc/group files using mkgroup and mkpasswd utilities. They include all groups and usernames that were in "strace ls" output (and more, but that's irrelevant). But running "ls" is still slow. "strace ls" now show this:
As you can see it has no more "pwdgrp::fetch_account_from_windows" lines. But there are still errors:
|
|
my case is slightly different; for me msys is slow on starting and on bash completion; but "ls" is fast see http://sourceforge.net/p/msys2/discussion/general/thread/87925e6f/ i also tried to create passwd/group; "mkgroup -d" doesn't output group from domain |
i "solved" disabling db in nsswitch.conf |
ok. |
This is great. Commenting out "db" from nsswitch.conf helps. Now all operations are fast for me. |
Disabling db from both passwd and group fixed the issue but led to my username being unrecognised (bash prompt showed me as Unknown+User). However, the "fix" was to just disable db from group and leave passwd as it was, and this sped up MSYS2 utilities like |
unfortunately now some commands are slower than some time ago; for example: ls, git status/diff, configure (autoreconf), gitk |
re-enabling db in nsswitch.conf makes these commands again fast; but it slows bash completion (TAB); the start of msys2_shell.bat is quite normal |
@KrullKorg Bash completion being slow has got nothing to do with MSYS2 itself. See here for an explanation. |
as i wrote bash completion isn't slow with db disabled in nsswitch.conf and slow if db is enabled; tomorrow i'll try again, to be sure of course I'm talking about a pc under ms (samba) domain; at home it works perfectly and yes i know that msys2 derived from cygwin |
i just tried under latest cygwin (1.7.5) and it works perfectly |
Notable differences between MSYS2 and Cygwin:
Can you look at differences between your Cygwin and MSYS2 installs? Namely I'm sorry I'm dumping all the debugging on you, but I don't currently have any domain to join here. |
i don't have /etc/passwd, /etc/group and cygserver in both msys2 and cygwin FSTAB - CYGWIN
FSTAB - MSYS2
NSSWITCH - CYGWIN
NSSWITCH - MSYS2
MOUNT - CYGWIN
MOUNT - MSYS2
PS: i just tried to remove db_enum from nsswitch.conf in msys2 |
Can you try to mount cygdrive in Cygwin with I'm assuming you're trying |
i changed /etc/fstab in cygwin but i got the same behavior adding noacl: it's fast and same behavior both in /home/ and in /c/ i also tried to remove noacl in msys2, but without improvements |
I'm out of ideas at this point. I don't know enough about Cygwin internals to suggest a good test for you. You can try searching the Cygwin mailing list, maybe some of the information there will apply to your situation. |
i just tried on a relative new pc (virtual machine) with windows 10 tp (under the same domain) and it seems to work... i installed msys2 from exe; then i upgraded with pacman -Syu so i'll try to use a clean windows 8.1 vm... maybe the problem is the windows version... or my pc |
i really think it's the fault of my pc; i tried also with windows 8 and it works i found on strace executed on my pc this error (that isn't present in virtual machines) 2388701 3040772 [main] ls 7032 pwdgrp::fetch_account_from_windows: LookupAccountSid(S-1-5-21-726227932-2052316878-829958588-513), Win32 error 1789 |
Interesting. KB976494 says the error is Can you try to leave and re-join the domain? |
yes i arrived at the same conclusion, and it worked |
I also faced the same issue with KrullKorg and legends2k's case. |
Very nice summary, @k-takata. |
@k-takata your workaround gist works great until I disconnect from the domain and hop onto another network... then it's slow again. |
I found that pacman installs are really slow until I applied @k-takata 's workaround. I wonder why it's so slow for it to do lookups on the domain? |
And why no cygserver? Cannot run now postgresql. Error like function is not implemented. |
Even after changing nsswitch.conf things are still a bit slow after dropping off an AD network. I found that disabling network and then re-enabling (using my laptop hardware button) made things responsive again. |
With a new msys2 installation today, I observed every process, the initial I tried the So I traced (*) |
Thanks for the info. Does this mean every time an executable under |
Yes. Signing adds a signature to the executable, so if the executable changes it'll need to be signed again. |
@i2000s |
@RonaldinhoL |
I've been encountering this exact same slowdown, but the |
I was able to reproduce this in a Windows 7 virtual machine. After doing an upgrade with |
On my friend's Windows 10 machine, updating did not help. |
unsubscribe
…-------------
Jim Michaels<jmichae3@yahoo.com>Renewal Computer Services, Vancouver, WA, USA (for now)
https://www.RenewalComputerServices.com (Software, Specifications, fixes)1-360-209-5351 business
On Thursday, September 27, 2018, 8:28:28 AM PDT, John Wiegley <notifications@github.com> wrote:
I was able to reproduce this in a Windows 7 virtual machine. After doing an upgrade with pacman -Syu followed by restarting the shell and running pacman -Su, solved the problem for me.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
|
I definitely think there's a culprit deep in some policies somewhere, between windows and linux, the same bash script runs ~50x faster on linux than it does on windows...I don't think it is I/O bound and I don't think it is a problem with AD lookups on files. AV was completely "off" although granted I have noticed in past "off" does not mean actually unloaded, sometimes that requires a reboot... And yet I was able to forkbomb the system relatively slowly, meaning whichever system is ultimately a useless slowdown (as it is doing something un-necessary and unhelpful). |
@Arnavion I didn't have a signing cert, I tried signing (not sure I did it correctly), nevertheless bash shows a large, large number of registry keys being opened. Trying a couple more updates before I dive further.... |
I too experienced extreme slowness on Win 10. This fixed it for me:
Then comment out mentions of |
Tried this and not sure if it made a difference yet. Need to run performance tests for comparison. I think most people could use this fix and it could be applied to the MSYS2 installer if it really does make a difference. |
@Arnavion I don't have a
I run your command on |
For me, it was also necessary (besides modifying |
Rather than removing AV entirely, try excluding the path mounted on |
Slow +1 |
I've tried both disabling the bash completion as well as the db in the nsswitch file... nothing changes, still very slow. I am on Windows 11 and there had been several Windows updates being applied... maybe this is related to some Windows updates...? sigh |
The issue for Bash run this way is someone needs to modify Bash itself to fit more into how Windows is designed to handle subprocesses and other concerns. There's no way around that. Until that happens this will always be slow. |
Are we sure is bash? I just noticed something, when I run And it looks like internally it spwns a bash shell and then it throws an insane amount of "internal exception"?
Thoughts? |
msys2 is extremely slow as a domain user, what happens if I disable db from nsswitch what are the consequences? |
msys2 in general is slow due to the POSIX emulation layer that it must do to translate ALL posix api's into Window's API this INCLUDES the IO drivers and console input/output drivers among other heavy drivers/layers |
@mgood7123, folks know. You are speaking about the general picture. And this issue is about the slow speed getting even slower – the particular cases. PS. Midipix is a bit faster because it uses NTAPI during the translation. |
I was talking about msys2 as a domain user, msys2 on normal windows installations is quick, so there is some networking happening, idk what, or maybe it's the antivirus checking every I/O, 🤷 |
Any tool I run in msys2 shell (ls, mv, ...) are very slow. Simply ls takes something like 3 seconds.
Running "strace ls" I see following output:
Could slowness be related to this? I am on non-admin user on this machine..
Can that be avoided?
The text was updated successfully, but these errors were encountered: