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

WSL seems to limit TCP sockets #12384

Open
1 of 2 tasks
ephemeris-lappis opened this issue Dec 16, 2024 · 7 comments
Open
1 of 2 tasks

WSL seems to limit TCP sockets #12384

ephemeris-lappis opened this issue Dec 16, 2024 · 7 comments

Comments

@ephemeris-lappis
Copy link

Windows Version

Microsoft Windows [version 10.0.22631.4460]

WSL Version

2.3.26.0

Are you using WSL 1 or WSL 2?

  • WSL 2
  • WSL 1

Kernel Version

Debian 5.15.167.4-microsoft-standard-WSL2 + Ubuntu 5.15.167.4-microsoft-standard-WSL2

Distro Version

Debian 10 + Ubuntu 22.04

Other Software

No response

Repro Steps

I'm working with to Linux distributions in WSL 2.
Kubernetes tools (kubectl, kubtctx, kubens) are installed on both : this allows connecting to distinct clusters.
I usually use port forwarding to allow accesses to different services on different pods of different namespaces.
This generally works.
When using Apache JMeter (for example) to execute load tests, many sockets my be opened.
It seems that when the opened sockets reach about 1000 (1024 ?) new connections fail.
After looking for Kubernetes or Windows limitations, I can confirm that connecting to any host from Windows or Linux is still possible while new sockets across WSL fail.
When this limit seems to be reached, whatever Linux is used, the only way to recover a normal behavior is after executing "wsl --shutdown".

Expected Behavior

No limit on TCP sockets.

Actual Behavior

Diagnostic Logs

No response

Copy link

Logs are required for review from WSL team

If this a feature request, please reply with '/feature'. If this is a question, reply with '/question'.
Otherwise please attach logs by following the instructions below, your issue will not be reviewed unless they are added. These logs will help us understand what is going on in your machine.

How to collect WSL logs

Download and execute collect-wsl-logs.ps1 in an administrative powershell prompt:

Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/microsoft/WSL/master/diagnostics/collect-wsl-logs.ps1" -OutFile collect-wsl-logs.ps1
Set-ExecutionPolicy Bypass -Scope Process -Force
.\collect-wsl-logs.ps1

The script will output the path of the log file once done.

If this is a networking issue, please use collect-networking-logs.ps1, following the instructions here

Once completed please upload the output files to this Github issue.

Click here for more info on logging
If you choose to email these logs instead of attaching to the bug, please send them to [email protected] with the number of the github issue in the subject, and in the message a link to your comment in the github issue and reply with '/emailed-logs'.

View similar issues

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

@ephemeris-lappis
Copy link
Author

Logs !
WslLogs-2024-12-16_09-01-22.zip

Copy link

Diagnostic information
Detected appx version: 2.3.26.0

@OneBlue
Copy link
Collaborator

OneBlue commented Dec 17, 2024

Thank you for reporting this @ephemeris-lappis. Can you share an strace of the process that's failing to create sockets ? I'm curious to see what the socket() error code is

@ephemeris-lappis
Copy link
Author

Here are two trace files, one from process monitor tracking a JConsole trying to connect to a distant JVM, and the corresponding WireShark's TCP exchanges.

The TCP flow seems to end prematurally with an inexpected RST.

The test is done after a JMeter executions that creates more than 1000 ActiveMQ connections, almost all failing. Even when the tests ended, no more connection can be succesfully established on any WSL instance (I have two Linux).

Note that any network activity from Windows is still working (LAN, Internet, etc.), except when the target is across WSL. And, as I said before, shutting down WSL is the only way to recover a normal connectivity.

I hope this can help you. Be free to ask for more details if needed.

traces.zip

Copy link

Failed to parse logs. Unexpected file: jconsole.pcap
The log file doesn't contain any WSL traces. Please make sure that you reproduced the issue while the log collection was running.

Diagnostic information
Found no WSL traces in the logs

@ephemeris-lappis
Copy link
Author

Thank you for reporting this @ephemeris-lappis. Can you share an strace of the process that's failing to create sockets ? I'm curious to see what the socket() error code is

Hello !
I've uploaded a zip with two files, but the robot seems to ask me for more logs...
Is it actually necessary ?

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