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

8% vmmem CPU usage on windows when top in WSL shows ~0 CPU usage when running WSL2 with the task scheduler of Windows 11 #8288

Closed
1 of 2 tasks
epigramx opened this issue Apr 14, 2022 · 8 comments

Comments

@epigramx
Copy link

Version

Microsoft Windows [Version 10.0.22000.613]

WSL Version

  • WSL 2
  • WSL 1

Kernel Version

5.10.102.1

Distro Version

Ubuntu 20.04

Other Software

No response

Repro Steps

Run WSL, in a way that in the ubuntu itself there's no siginificant cpu usage. See task manager show vmmem have near 10% cpu usage on an 8-thread CPU.

Expected Behavior

It used to be near 0% usage.

Actual Behavior

near 10% cpu usage on an 8-thread CPU

Diagnostic Logs

image

image

@epigramx
Copy link
Author

It probably started, after I installed 11 over windows 10, but I'm not sure if it's related.

@epigramx
Copy link
Author

epigramx commented Apr 14, 2022

It appears to alleviate if I wsl --shutdown and then start it again, but I don't see why that would happen, since the only thing different is that I start it on a schedule task at windows boot which also brings ubuntu cron and rsyslogd up (with wsl sudo) but if I kill those two processes during the problem: it does not fix it and they appear 0% cpu usage in top even when they run anyway (and vmmem stays low cpu even when I start cron and rsyslogd manually later after the --shutdown and restart of wsl!).

@epigramx
Copy link
Author

epigramx commented Apr 14, 2022

OK there's definitely a problem with starting wsl with the windows 11 task scheduler specifically, even if no service is run with it at all or even if wsl.conf runs no service. I can't imagine what might cause it when top in-linux shows ~0 cpu usage.

@epigramx epigramx changed the title 8% vmmem CPU usage on windows when top in WSL shows ~0 CPU usage 8% vmmem CPU usage on windows when top in WSL shows ~0 CPU usage when running WSL2 with the task scheduler of Windows 11 Apr 14, 2022
@epigramx epigramx mentioned this issue Apr 14, 2022
2 tasks
@elsaco
Copy link

elsaco commented Apr 14, 2022

@epigramx don't rely too much on those readings. With one single idling WSL instance, the output is different when checked as admin:

As administrator:

PS C:\Users\tux> get-process -name vmmem

 NPM(K)    PM(M)      WS(M)     CPU(s)      Id  SI ProcessName
 ------    -----      -----     ------      --  -- -----------
      0   939.91     938.02       3.11   13228   0 vmmem

As non-admin user:

PS C:\Users\tux> get-process -name vmmem

 NPM(K)    PM(M)      WS(M)     CPU(s)      Id  SI ProcessName
 ------    -----      -----     ------      --  -- -----------
      0   937.91     936.02       0.00   13228   0 vmmem

While the PM (paged memory) and WS (working sets) are very close, the CPU usage is different.

Also, the top readings have no relationship to the host. While your vm is idle, with top showing zero cpu usage, the hypervisor is not. vmmem is what the hypervisor thinks the vm(s) is using.

@epigramx
Copy link
Author

@elsaco it's definitely correlated to actual hardware usage, because I can physically hear the CPU fan working harder when vmmem is at 8% cpu usage instead of ~0%.

There's something weird going on when it starts from the task scheduler instead of normally (even if it's not done at boot but with a right click on the scheduler).

@fgielow
Copy link

fgielow commented Jun 16, 2022

It's odd because if I use htop instead of top, it still does not show correct CPU usage on the processes listed (similar to top), but the graphical represensation of the cores show they are all really busy (which indeed happens inside WSL2 as I am running tilt there, which is the routine strressing all my cores as it serves a kubernetes cluster locally).

Captura de tela 2022-06-16 114738

@jcary741
Copy link

jcary741 commented Jul 15, 2022

I am seeing this issue also, vmmem will run a steady 40% CPU when cron is started by the Task Scheduler.
Here's how I had configured the task:
image
image
image

Starting cron manually works normally.

Copy link
Contributor

This issue has been automatically closed since it has not had any activity for the past year. If you're still experiencing this issue please re-file this as a new issue or feature request.

Thank you!

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

4 participants