WSL2 is slow and makes my computer unresponsive when running a C++ build in Debug mode inside Docker container
pksilen opened this issue · 11 comments
Windows Version
10.0.19044.4291
WSL Version
2.1.5.0
Are you using WSL 1 or WSL 2?
- WSL 2
- WSL 1
Kernel Version
5.15.146.1-2
Distro Version
Ubuntu 22.04
Other Software
Docker 25.0.3
Gcc 13. But this problem has appeared with earlier version of Gcc also.
Repro Steps
Inside a Docker container, compile a C++ project in Debug mode using 'make' command e.g.
make -j 16}; \
Expected Behavior
Normal build that takes a normal time
Actual Behavior
Build is extremely slow and makes the whole computer unresponsive, e.g. trying to start an application takes a long time. However, CPU usage is not close to 100%.
Diagnostic Logs
When I run the same build in Release mode, the build executes in a normal fashion (fast).
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 scipt will output the path of the log file once done.
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 wsl-gh-logs@microsoft.com 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:
- WSL2 mounted host drive access hangs after a short while (#9654), similarity score: 0.70
Note: You can give me feedback by thumbs upping or thumbs downing this comment.
Logs attached
WslLogs-2024-05-06_12-57-22.zip
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
.wslconfig found
Detected appx version: 2.1.5.0
Found no WSL traces in the logs
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 scipt will output the path of the log file once done.
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 wsl-gh-logs@microsoft.com 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:
- WSL Becomes Non Responsive, Uses High Amounts Of CPU & Memory (#9429), similarity score: 0.72
Closed similar issues:
- WSL2 has suddenly slow for example when compiling (#8833), similarity score: 0.73
- WSL2 Slowing down over time (August 2020) (#5832), similarity score: 0.73
- CPU Performance Regression on Windows Host When WSL2 is Running (#9019), similarity score: 0.72
- [WSL 1] Windows takes minutes to launch new programs after running make in Ubuntu (#6429), similarity score: 0.71
Note: You can give me feedback by thumbs upping or thumbs downing this comment.
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 scipt will output the path of the log file once done.
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 wsl-gh-logs@microsoft.com 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:
- WSL Becomes Non Responsive, Uses High Amounts Of CPU & Memory (#9429), similarity score: 0.72
Closed similar issues:
- WSL2 has suddenly slow for example when compiling (#8833), similarity score: 0.74
- CPU Performance Regression on Windows Host When WSL2 is Running (#9019), similarity score: 0.72
- Cmake freezes completely (#9939), similarity score: 0.72
- [WSL2] running multiple processes at once results in extreme slowdown of some (filesystem?) operations and
htop
reporting impossible CPU usage (#6891), similarity score: 0.72
Note: You can give me feedback by thumbs upping or thumbs downing this comment.
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 scipt will output the path of the log file once done.
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 wsl-gh-logs@microsoft.com 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!
Closed similar issues:
- WSL2 has suddenly slow for example when compiling (#8833), similarity score: 0.76
- CPU Performance Regression on Windows Host When WSL2 is Running (#9019), similarity score: 0.73
- WSL2 Slowing down over time (August 2020) (#5832), similarity score: 0.73
- Very bad performance in WSL (IO Operations) (#9555), similarity score: 0.72
- [WSL 1] Windows takes minutes to launch new programs after running make in Ubuntu (#6429), similarity score: 0.72
Note: You can give me feedback by thumbs upping or thumbs downing this comment.
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 scipt will output the path of the log file once done.
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 wsl-gh-logs@microsoft.com 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:
- WSL2 mounted host drive access hangs after a short while (#9654), similarity score: 0.72
Closed similar issues:
- WSL2 has suddenly slow for example when compiling (#8833), similarity score: 0.75
- Very bad performance in WSL (IO Operations) (#9555), similarity score: 0.74
- WSL2 Slowing down over time (August 2020) (#5832), similarity score: 0.72
- CPU Performance Regression on Windows Host When WSL2 is Running (#9019), similarity score: 0.72
Note: You can give me feedback by thumbs upping or thumbs downing this comment.
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 scipt will output the path of the log file once done.
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 wsl-gh-logs@microsoft.com 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:
- WSL2 mounted host drive access hangs after a short while (#9654), similarity score: 0.73
- WSL2 intermittently slows/hangs on Windows on ARM (#10667), similarity score: 0.72
Closed similar issues:
- Very bad performance in WSL (IO Operations) (#9555), similarity score: 0.75
- WSL2 has suddenly slow for example when compiling (#8833), similarity score: 0.74
- WSL2 Slowing down over time (August 2020) (#5832), similarity score: 0.71
Note: You can give me feedback by thumbs upping or thumbs downing this comment.
When trying to capture the logs, I get the below message. Please advice
Set-ExecutionPolicy : Windows PowerShell updated your execution policy successfully, but the setting is overridden by
a policy defined at a more specific scope. Due to the override, your shell will retain its current effective
execution policy of RemoteSigned. Type "Get-ExecutionPolicy -List" to view your execution policy settings. For more
information please see "Get-Help Set-ExecutionPolicy".
At line:2 char:1
+ Set-ExecutionPolicy Bypass -Scope Process -Force
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : PermissionDenied: (:) [Set-ExecutionPolicy], SecurityException
+ FullyQualifiedErrorId : ExecutionPolicyOverride,Microsoft.PowerShell.Commands.SetExecutionPolicyCommand