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

Performance accessing WSL2 instance via localhost is dismal #5069

Closed
pds2208 opened this issue Apr 10, 2020 · 4 comments
Closed

Performance accessing WSL2 instance via localhost is dismal #5069

pds2208 opened this issue Apr 10, 2020 · 4 comments

Comments

@pds2208
Copy link

pds2208 commented Apr 10, 2020

Please use the following bug reporting template to help produce issues which are actionable and reproducible, including all command-line steps necessary to induce the failure condition. Please fill out all the fields! Issues with missing or incomplete issue templates will be closed.

If this is a console issue (a problem with layout, rendering, colors, etc.), please post to the console issue tracker.

Important: Do not open GitHub issues for Windows crashes (BSODs) or security issues. Please direct all Windows crashes and security issues to [email protected]. Ideally, please configure your machine to capture minidumps, repro the issue, and send the minidump from "C:\Windows\minidump".\

See our contributing instructions for assistance.

Please fill out the below information:

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

10.0.19041.173

  • 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.)

Doing a large number of network request to a WSL 2 instance using 'localhost' is around > 10 times slower than access the instance via its IP address. For example, a large number of inserts into a database running either directly in WSL or via Docker. See https://www.reddit.com/r/bashonubuntuonwindows/comments/fxe3wu/postgres_in_wsl2_performance/

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

There should be no performance difference between localhost and the WSL2 instance IP address

  • 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).

  • For WSL launch issues, please collect detailed logs.

@pds2208 pds2208 changed the title Performance accessing ontainer via localhost Performance accessing WSL2 instance via localhost Apr 10, 2020
@pds2208 pds2208 changed the title Performance accessing WSL2 instance via localhost Performance accessing WSL2 instance via localhost is dismal Apr 10, 2020
@therealkenc
Copy link
Collaborator

/dupe #4946 (with side order of #4901)

@ghost
Copy link

ghost commented Apr 10, 2020

Hi! We've identified this issue as a duplicate of another one that already exists in this repository. This specific instance is being closed in favor of tracking the concern over on the referenced thread.

Thanks for your report!

@pds2208
Copy link
Author

pds2208 commented Apr 11, 2020

Okay. I guess down you can now narrow it down to something to do with using localhost rather than the IP address. Hope it helps and hope it gets fixed soon.

@eldiablolives
Copy link

@pds2208 you are right, when accessing localhost be it through alias or IP address, it is dead slow, accessing through network is fast, so if you do ifconfig in WSL, find out your IP address then access through that IP address then it's all good. Problem with that 1) I've got to serve apps on 0.0.0.0 2) I have to look it up on DHCP change.

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

3 participants