-
Notifications
You must be signed in to change notification settings - Fork 834
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
Establishing network connections in WSL is slow #1585
Comments
This is very much not a blocker for me. It just caught my attention so I figured I would post it. It does in particular tend to make integration tests for Web applications run significantly slower under WSL than with the same code under Linux, since (in my experience at least) that type of test basically consists of a huge number of HTTP requests verifying correct behavior for each endpoint for a variety of different inputs. |
Thanks @aseering. There is really not much that happens in WSL during the |
Hm -- this may have been a red herring. My Insider machine had been acting up recently; I eventually realized that its CPU was sometimes (inconsistently) getting pegged at its lowest-power state regardless of CPU temperature or system load. (I have no idea why. I filed a report through the Feedback app.) I just re-ran the WSL test while verifying that the CPU was running at full speed. Updated numbers:
Still significantly slower. But small-constant-factor slower; not log-scale-plot slower :-) Much more reasonable. Feel free to close this out and/or de-prioritize it. |
Also, I should note -- I don't know that the time is going to |
Thanks @aseering for the update. I have readjusted the label such that this is more of a discussion now. |
Just an update that |
Please use the following bug reporting template to help produce actionable and reproducible issues. Please try to ensure that the reproduction is minimal so that the team can go through more bugs!
A brief description
See subject. I haven't benchmarked the specific syscalls, but I have noticed empirically that a number of applications that I have that churn through sockets quickly are substantially (~10x) slower under WSL than under Linux.
Expected results
Open up two terminal windows.
Then,
Then,
Note that I didn't compare on identical hardware; the comparison is unfair in the wrong direction: The machine running WSL is much faster (modern Core i5 CPU) than the machine running Linux (older Intel Atom CPU -- I expect this operation to be CPU-bound) in this instance. So I would expect WSL to complete this operation significantly faster than Linux, when in fact it is a bunch slower.
Just for comparison / to get a sense of "is it the sender or the receiver that's slow in WSL?": (This is not the same physical machine so it's not a great test, but it's the same subnet on a gigabit LAN so latency should be relatively low.
%sys
and%user
should be somewhat meaningful, at least.)I have observed comparable slow-downs with more-optimized code that repeatedly opens sockets within a single application. I can cook up a tighter reproducer if you need one that doesn't rely on a low-performance Python server and a client that's launching a new process for every request.
Your Windows build number
15002
Steps / All commands required to reproduce the error from a brand new installation
See above. Let me know if you'd like more details.
Strace of the failing command
The strace is quite large and I'm not sure it's the most useful thing in this situation. Let me know if you'd like it; I can easily generate and post it.
Required packages and commands to install
I think
curl
,python
, andtime
are all builtins? If not, they're inapt
.See our contributing instructions for assistance.
The text was updated successfully, but these errors were encountered: