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

High CPU usage in WSL after last update #4637

Closed
Salmondx opened this issue Mar 9, 2021 · 12 comments
Closed

High CPU usage in WSL after last update #4637

Salmondx opened this issue Mar 9, 2021 · 12 comments
Assignees
Labels
wsl Issue in vscode-remote WSL
Milestone

Comments

@Salmondx
Copy link

Salmondx commented Mar 9, 2021

After recent update of VSCode, a CPU usage of a node process from vscode-remote extension is incredibly high. This process constantly consumes 30-40% of CPU.

VSCode version: 1.54.1
vscode-remote extension version: 0.54.2
WSL 1
Ubuntu 18.04

I tried to run vscode's developer tools to check resources usage and to collect performance profile, it doesn't show anything. Also disabling all other extensions doesn't help. Obviously it works ok only when I run vscode natively in windows, not from WSL.

Any ideas why it is happening and what info I can provide to you to help with debugging?

@github-actions github-actions bot added the wsl Issue in vscode-remote WSL label Mar 9, 2021
@Salmondx
Copy link
Author

Rolling back to the previous version of extension (1.54.0) also didn't help. Looks like the problem is again with WSL? Any suggestions how to debug what is causing node to consume so much CPU in idle?

@Salmondx
Copy link
Author

microsoft/WSL#4898

I tried to follow this issue, but my libc version is 2.27-3ubuntu1.4, not >=2.30

@aeschli
Copy link
Contributor

aeschli commented Mar 11, 2021

Can you check the Process Explorer (Help > Open Process Explorer) and scroll to the bottom to the WSL processes? Would be interesting to see which process is busy.

@Salmondx
Copy link
Author

Thanks for a response! Looks like process explorer shows that wsl processes doesn't consume any resources:
image

But at the same time this is what I see in windows task manager:
image

And if I open file location of this process, it opens folder with vscode-remote extension:
image

@telecasterer
Copy link

telecasterer commented Mar 12, 2021

I have the exact same issue

image

@aeschli aeschli self-assigned this Mar 12, 2021
@aeschli
Copy link
Contributor

aeschli commented Mar 12, 2021

Can you set "remote.WSL.fileWatcher.polling": false and see if the problem goes away?

@telecasterer
Copy link

Can you set "remote.WSL.fileWatcher.polling": false and see if the problem goes away?

Thanks but that doesn't fix it for me.

@Salmondx
Copy link
Author

@aeschli tried to disable polling and it helped. So something is broken with file polling in a new vscode release/WSL?

@Piroro-hs
Copy link

Piroro-hs commented Mar 13, 2021

I have the same issue and disabling the polling helped (CPU usage by node process 50% -> 1%).
VSCode: 1.54.1
Remote - WSL: 0.54.3
Windows: 10.0.19042
WSL: 1
Ubuntu: 18.04

@aeschli
Copy link
Contributor

aeschli commented Mar 15, 2021

watching by file polling is CPU costly by nature. It's basically scanning the open folder every 5 seconds (Can be configured by remote.WSL.fileWatcher.pollingInterval).

But polling is currently the only way to get reliable file events when on a /mnt/...

@Salmondx
Copy link
Author

I'm using WSL and vscode-remote extension since it was released, and I never had such problem until recent vscode release. In the exact same environment, without any changes it was working fine until ~week ago.

Maybe they changed a default polling interval or something else?

@aeschli aeschli added this to the March 2021 milestone Mar 16, 2021
@aeschli
Copy link
Contributor

aeschli commented Mar 16, 2021

I have now disabled polling by default. Published ms-vscode-remote.remote-wsl@0.54.5

@aeschli aeschli closed this as completed Mar 16, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Apr 30, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
wsl Issue in vscode-remote WSL
Projects
None yet
Development

No branches or pull requests

4 participants