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

Very slow on Windows 11? #26

Closed
mendhak opened this issue Jul 29, 2022 · 2 comments
Closed

Very slow on Windows 11? #26

mendhak opened this issue Jul 29, 2022 · 2 comments

Comments

@mendhak
Copy link

mendhak commented Jul 29, 2022

Is anyone experiencing slowness issues on Windows 11?

I'm using this from WSL2 to connect to the OpenSSH Agent, like so

# KeepassXC as SSH agent
export SSH_AUTH_SOCK=$HOME/.ssh/agent.sock

ss -a | grep -q $SSH_AUTH_SOCK
if [ $? -ne 0 ]; then
    rm -f $SSH_AUTH_SOCK
    (setsid socat UNIX-LISTEN:$SSH_AUTH_SOCK,fork EXEC:"$HOME/npiperelay/npiperelay.exe -ei -s //./pipe/openssh-ssh-agent",nofork &) >/dev/null 2>&1
fi

And it works, but it takes about 25-30 seconds for any SSH or Git-over-SSH operations.

I even tried a straight up, direct call to it.

time $HOME/npiperelay/npiperelay.exe --help

And that took 25 seconds. Everything else in the WSL2 is fast, no slowdowns that I can see, so I think it's just this npiperelay. I've tried building it via go, and also getting it from the Releases of this repo, same problem.

I'm not famliar with ss, or socat or nipiperelay so I'm not sure how to troubleshoot this or figure out what's going wrong.

@a-m-s
Copy link

a-m-s commented Aug 4, 2022

Have you followed the instructions to put the binary in the Windows file system with a soft-link from Linux? I too observed a delay of a few seconds when I tried to run it in the Linux file system, but that's Windows 10 so it might be different.

@mendhak
Copy link
Author

mendhak commented Aug 4, 2022

Thank you so much! You're right, that made a huge difference. And the README even calls me out on it 😀

You may be tempted to just put the real binary directly into /usr/local/bin, but this will not work because Windows currently cannot run binaries that exist in the Linux namespace -- they have to reside somewhere under the Windows portion of the file system.

So it was working for me somehow, fine in Win10, but very slowly in Win11. As a test, I moved the .exe to C:/Temp and created a symlink,

sudo ln -s /c/Temp/npiperelay.exe /usr/local/bin/npiperelay.exe

Then in my .bashrc

# KeepassXC as SSH agent
export SSH_AUTH_SOCK=$HOME/.ssh/agent.sock

ss -a | grep -q $SSH_AUTH_SOCK
if [ $? -ne 0 ]; then
    rm -f $SSH_AUTH_SOCK
    (setsid socat UNIX-LISTEN:$SSH_AUTH_SOCK,fork EXEC:"/usr/local/bin/npiperelay.exe -ei -s //./pipe/openssh-ssh-agent>fi

Yep it's back to regular speeds. Thanks so much @a-m-s even if it was super obvious!

@mendhak mendhak closed this as completed Aug 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants