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 while Docker Desktop is running on Windows #12266

Open
3 tasks done
wallyhall opened this issue Oct 12, 2021 · 214 comments
Open
3 tasks done

High CPU usage while Docker Desktop is running on Windows #12266

wallyhall opened this issue Oct 12, 2021 · 214 comments

Comments

@wallyhall
Copy link

wallyhall commented Oct 12, 2021

  • I have tried with the latest version of Docker Desktop (have confirmed is still an issue on 4.1.1 since posting this issue)
  • I have tried disabling enabled experimental features
  • I have uploaded Diagnostics
  • Diagnostics ID: 89095665-3DDA-44A6-9170-6A3E12A4657B/20211012155209

Actual behavior

As per original issue:

High CPU usage on the Vmmem process while docker desktop is running
16% constant usage on CPU Intel(R) Core(TM) i9-9980HK CPU, aka 8 core machine
Windows Task manager also reports "Very High" power usage from the process while Docker Desktop is running.

(I'm on a i7, but the symptoms remain very similar. "Idle" CPU usage can be anywhere from 15% to upward of 30% ... it seems to be higher after some containers have been running, even if they're then all stopped.)

Expected behavior

As per original issue:

No CPU activity when no containers are running

Information

  • Windows Version: 11 (although I was experiencing this on 10 too)
  • Docker Desktop Version: 4.1.1 (and confirmed on 4.1.0 too)
  • WSL2 or Hyper-V backend? WSL2
  • Are you running inside a virtualized Windows e.g. on a cloud server or a VM: No, it's on a physical laptop.

Steps to reproduce the behavior

  1. Start Docker Desktop, and leave it idle with no containers running.

Following Poxmax's request to create a new issue.

The problem (in symptoms) as described under #6947 still remains for me in Docker 4.1.0. I have no further information to add, the symptoms are identical - as far as I can tell it is precisely the same issue as was reported before and was closed after 90 days of inactivity.

I can confirm I am on version 4.1.0, using WSL2 (as described by others in the original issue).

I'm not a Docker Desktop power user - I don't know how to debug it - but if anyone (@Pomax for example) can guide me through any additional useful information I can provide, I'll happily try to oblige.

@wallyhall If you're going to unstale an issue, at least add more details, because you just pinging everyone with a "me too" for an issue that's basically moot. It'd be far better to file a new issue, with your new problem description, both so docker folks can look at it in relation to what Docker looks like now instead of several versions ago, and for all the people you just pinged.

Originally posted by @Pomax in #6947 (comment)

Just for the sake of saving people having to click back to an old ticket which was closed due to inactivity - I'm quoting the original issue (which precisely describes my experience). The only environmental differences I can see is I'm on Docker Desktop 4.1.0 (there were people discussing the issue on the old thread less than 6 months ago), and I happen to be on Windows 11 (but I was experiencing this issue before I upgraded from Windows 10).

@wallyhall
Copy link
Author

Screenshot showing the issue I'm observing - the CPU usage goes away as soon as I quit Docker Desktop.

I've tried to upload another diagnostic capture (during this high CPU usage), but I get an error while uploading it (Internal Server Error). I've saved the report locally though, if anyone wants anything from it.

The CPU usage on this example was particularly high - causing significant lag on the machine.

image

@vladimmi
Copy link

#2854 - 2018, stale, locked
#3811 - 2019, stale, locked
#4773 - 2019, stale, locked
#4977 - 2019, stale, locked
#6947 - 2020, stale, locked
#8742 - 2020
#11378 - 2021, stale, locked
now this one, silent

It seems devs expect it to disappear on its own at some time, otherwise I see no point in automatic closing of issues because that doesnt actually fix them.

@jibbers42
Copy link

Shame I didn't get any coal for Christmas, I could have used it to help power my Vmmem...

@ColinPM
Copy link

ColinPM commented Feb 25, 2022

Just started happening on my machine - funny enough it did not happen on Windows 10 but is happening on Windows 11. Using 1 core 100% of the time. Stopping a container doesn't stop it - only exiting the Docker Desktop application. I upgraded to 4.5.1 and that's when I noticed it. I saw the original earlier ticket and the advice to wallyhall to open a new ticket and then found his newer ticket. This is still an issue :-(

@bill-finlay-ssd
Copy link

I was experiencing this same issue on Windows 10 Pro: perpetual ~30% CPU utilization despite no containers running. I'm running Docker Desktop 4.5.1 (74721) currently but saw it happening on 4.5.0 earlier today and hoped that updating to 4.5.1 would fix it. It did not.

How I eventually fixed it: I disabled "Automatically check for updates" and manually closed and restarted Docker Desktop. Now Docker Desktop is utilizing around 0% to 1% CPU.

I hope this fixes the issue for others, too.

@bn-s
Copy link

bn-s commented Mar 5, 2022

I was experiencing this same issue on Windows 10 Pro: perpetual ~30% CPU utilization despite no containers running. I'm running Docker Desktop 4.5.1 (74721) currently but saw it happening on 4.5.0 earlier today and hoped that updating to 4.5.1 would fix it. It did not.

How I eventually fixed it: I disabled "Automatically check for updates" and manually closed and restarted Docker Desktop. Now Docker Desktop is utilizing around 0% to 1% CPU.

I hope this fixes the issue for others, too.

This works for me. Went from a constant ~20% CPU usage back down to <1%.

Information

  • Windows 11 Pro
  • Docker Desktop 4.5.1
  • WSL2 backend
  • Was not running inside a virtualized Windows

@Raton-Laveur
Copy link

I was experiencing this same issue on Windows 10 Pro: perpetual ~30% CPU utilization despite no containers running. I'm running Docker Desktop 4.5.1 (74721) currently but saw it happening on 4.5.0 earlier today and hoped that updating to 4.5.1 would fix it. It did not.

How I eventually fixed it: I disabled "Automatically check for updates" and manually closed and restarted Docker Desktop. Now Docker Desktop is utilizing around 0% to 1% CPU.

I hope this fixes the issue for others, too.

Same behavior with 4.6.1, same fix still works.

@b-hayes
Copy link

b-hayes commented Apr 13, 2022

I've been sitting here wondering why my laptop fan is screaming at me all day. I have containers running but nothing is actually happening they're just idling and my CPU was sitting at 34wt power draw.
Close the docker decktop and it drops down and goes quiet.

Open docker with no containers running and the same result, CPU power jumps to 34wats temps jumps to 85degress and the fans ramp up again.

@seeker
Copy link

seeker commented Apr 19, 2022

The issue is still present in Docker Desktop 4.7.0 (77141), workaround still works.

@fernando2amigos
Copy link

Windows 11 @ Docker desktop 4.7.1 (just updated)
Exactly same behavior: from 40% CPU usage to 0% by disabling check for updates.
C'mon, really!?!?

Before
Screenshot 2022-04-20 114820

After (no even restarting Win; just exit & start Docker Desktop)
Screenshot 2022-04-20 115957

@vladimmi
Copy link

Considering the facts that first such issue here was opened almost 4 years ago and lots of them were closed as stale, Docker devs have zero wish to fix anything. Whole issues functionality can be disabled on this repo as useless.

@vash1486
Copy link

The issue is still present in Docker Desktop 4.7.0 (77141), workaround still works.

same for 4.7.1 (77678)

@perclausen
Copy link

perclausen commented Apr 24, 2022

Windows 11 @ Docker desktop 4.7.1 (just updated) Exactly same behavior: from 40% CPU usage to 0% by disabling check for updates. C'mon, really!?!?

Before Screenshot 2022-04-20 114820

After (no even restarting Win; just exit & start Docker Desktop) Screenshot 2022-04-20 115957

See the same on Windows 10, 25-30% CPU usage - did not help disabling automatic updates (have tried restarting PC).
Docker version 4.7.1 (77678).

image

Same when paused...
image

@Firsh
Copy link

Firsh commented Apr 25, 2022

For me too, on the latest version. The % is equal to 100/number-of-logical-processors by the way. Disabled updates, now fingers crossed that it'll stay near 0%.

@perclausen
Copy link

The disable updates workaround was not enough in my case but after a Reset to factory defaults CPU usage is down to 0-1% when idle.

image

@enr1424
Copy link

enr1424 commented Apr 26, 2022

The disable updates workaround was not enough in my case but after a Reset to factory defaults CPU usage is down to 0-1% when idle.

image

Same here, and the curious thing is that now CPU usage is down to 0 even with automatic updates enabled...

@Mr1008
Copy link

Mr1008 commented Apr 28, 2022

Delete ~/.docker and check if it helps. Resetting and cleaning/purging did not help in my case but deleting this folder helped immediately

@arturoarevalo
Copy link

Deleting ~/.docker folder was the only solution that worked for me! Thanks @jmichalek-fp, this issue was driving me crazy as I am running Docker Desktop on a laptop and fans were mostly always on!

@Firsh
Copy link

Firsh commented May 1, 2022

I ended up uninstalling, then putting Docker inside WSL. Much better (and slimmer) experience. The GUI is now Portainer.

@maffe
Copy link

maffe commented May 2, 2022

When this high CPU usage occured, I opened Process Explorer, checked the threads of Docker Desktop.exe and the one with the highest CPU usage often showed a FatalException in its stack. To me it looks like there is something failing and instead of cancelling it is tried over and over again.

Disabling automatic updates seems to fix it for me, too. Also happens with disabled automatic updates, without running containers.

Sample stacktraces:

Docker Desktop.exe!Cr_z_crc32+0x1c2392
Docker Desktop.exe!Cr_z_crc32+0xae534
Docker Desktop.exe!cppgc::internal::WriteBarrier::DijkstraMarkingBarrierRangeSlow+0x2f08b3
Docker Desktop.exe!cppgc::internal::WriteBarrier::DijkstraMarkingBarrierRangeSlow+0x2f43cb
Docker Desktop.exe!GetMainTargetServices+0x10c9ed9
Docker Desktop.exe!node::FatalException+0x1e0f22
Docker Desktop.exe!uv_fs_get_ptr+0x3aec4c
Docker Desktop.exe!GetMainTargetServices+0xb61ecf
Docker Desktop.exe!Cr_z_uncompress+0xde562
Docker Desktop.exe!node::FatalException+0x1e12ce
Docker Desktop.exe!cppgc::internal::WriteBarrier::DijkstraMarkingBarrierRangeSlow+0x2ea938
Docker Desktop.exe!Cr_z_crc32+0xaeb6a
Docker Desktop.exe!uv_sleep+0x42d83
Docker Desktop.exe!uv_sleep+0x4d33a
Docker Desktop.exe!uv_fs_get_ptr+0x4b7e45
Docker Desktop.exe!uv_mutex_destroy+0x15b372
Docker Desktop.exe!v8::SharedMemoryStatistics::read_only_space_size+0x28fa
Docker Desktop.exe!v8::Isolate::GetNumberOfDataSlots+0xaf1
Docker Desktop.exe!std::__1::vector<v8::CpuProfileDeoptFrame,std::__1::allocator<v8::CpuProfileDeoptFrame> >::begin+0x7611c
Docker Desktop.exe!std::__1::vector<v8::CpuProfileDeoptFrame,std::__1::allocator<v8::CpuProfileDeoptFrame> >::begin+0x768e4
Docker Desktop.exe!cppgc::SourceLocation::SourceLocation+0xb7ad
Docker Desktop.exe!Cr_z_crc32+0x4608a2
KERNEL32.DLL!BaseThreadInitThunk+0x14
ntdll.dll!RtlUserThreadStart+0x21
Docker Desktop.exe!cppgc::internal::WriteBarrier::DijkstraMarkingBarrierRangeSlow+0x2ff921
Docker Desktop.exe!v8::String::ExternalStringResourceBase::Dispose+0x80af7
Docker Desktop.exe!v8::String::ExternalStringResourceBase::Dispose+0x7ddb4
Docker Desktop.exe!Cr_z_uncompress+0xde225
Docker Desktop.exe!node::FatalException+0x1e12ce
Docker Desktop.exe!cppgc::internal::WriteBarrier::DijkstraMarkingBarrierRangeSlow+0x2ea938
Docker Desktop.exe!Cr_z_crc32+0xaeb6a
Docker Desktop.exe!uv_sleep+0x42d83
Docker Desktop.exe!uv_sleep+0x4d33a
Docker Desktop.exe!uv_fs_get_ptr+0x4b7e45
Docker Desktop.exe!uv_mutex_destroy+0x15b372
Docker Desktop.exe!v8::SharedMemoryStatistics::read_only_space_size+0x28fa
Docker Desktop.exe!v8::Isolate::GetNumberOfDataSlots+0xaf1
Docker Desktop.exe!std::__1::vector<v8::CpuProfileDeoptFrame,std::__1::allocator<v8::CpuProfileDeoptFrame> >::begin+0x7611c
Docker Desktop.exe!std::__1::vector<v8::CpuProfileDeoptFrame,std::__1::allocator<v8::CpuProfileDeoptFrame> >::begin+0x768e4
Docker Desktop.exe!cppgc::SourceLocation::SourceLocation+0xb7ad
Docker Desktop.exe!Cr_z_crc32+0x4608a2
KERNEL32.DLL!BaseThreadInitThunk+0x14
ntdll.dll!RtlUserThreadStart+0x21

The process with the high CPU usage uses only a small amount of RAM, about 10 MB.

@briantist
Copy link

briantist commented May 5, 2022

Suddenly had this start happening today (no containers running) after upgrading to 4.7.1 (77678). I never experienced it before.
Unchecking "Automatically check for updates" did not change anything for me.

Deleting ~/.docker (assuming in WSL?) also did not help for me.

@wallyhall
Copy link
Author

Maybe the changes to the license agreement on Docker Desktop was to raise funds to fix this bug.

ahem

@hacklschorsch
Copy link

hacklschorsch commented May 6, 2022

Disabling update checking didn't do it for me, and I also did not want to delete all my containers and volumes...

@maffe got me thinking with his writing:

To me it looks like there is something failing and instead of cancelling it is tried over and over again.

I had a couple of (shut down) Containers with a shared Volume in a folder that did not exist anymore.
Maybe Docker was (re)trying to create the folder for that Volume in the now non-existing folder?
I didn't need the containers any more (that's also why I had moved the Volume to some archive), and used this neat command line to remove all containers based on the common Image name.

Ever since my laptop has been quiet again, much to the relief of my office mates :)

@TimGels
Copy link

TimGels commented May 7, 2022

When I suspend the process with process explorer, it seems to "fix" the issue for me until I quit and launch docker desktop again (obviously). At least I am able to not have a turbine engine for the time being.
afbeelding

@Mr1008
Copy link

Mr1008 commented May 7, 2022

@TimGels please check if this helps #12266 (comment)

@daniel-liuzzi
Copy link

I was having the same problem on latest Docker Desktop 4.7.1, tried every suggestion in this thread to no avail, but I did notice something: Pi-hole was blocking lots of requests to api.segment.io

Thinking it could be related, I disabled Pi-hole and restarted Docker Desktop. CPU usage dropped to ~2%. Re-enabled Pi-hole, restarted DD, CPU went up to ~30%. I consistently reproduced this behavior a few more times but now, weirdly enough, CPU usage is low even with Pi-hole enabled.

It would seem like DD was desperately attempting to upload telemetry data and failing, causing high CPU usage, but once it succeeded it finally settled down. Or so I would think.

@TimGels
Copy link

TimGels commented May 7, 2022

@TimGels please check if this helps #12266 (comment)

jmichalek-fp Is this inside the WSL? And does that delete my containers? I am currently in the middle of working on something and would rather not delete my containers if possible.

@Mr1008
Copy link

Mr1008 commented May 8, 2022

@TimGels please check if this helps #12266 (comment)

jmichalek-fp Is this inside the WSL? And does that delete my containers? I am currently in the middle of working on something and would rather not delete my containers if possible.

No this is within your windows profile directory. It is a directory with docker contexts so you may or may not lose your data. I would do it with data backed up or when you are not in the middle of something.

Anyway this is the only thing that helped in my case.

@LiamKarlMitchell
Copy link

Now I have thousands of com.docker.cli.exe processes running.
Is it safe to end task them?

@peiwenxu
Copy link

Disable auto checking update works. The issue still happening today

@AdamoT
Copy link

AdamoT commented Dec 30, 2023

DD at v4.25.2, WSL at v2.0.9.0 and the issue still exists. Disabling auto updates and diagnostic data helps somehow. It doesn't consume 90% of CPU anymore but still - Vmmem sits at around 4-10% and DD Backend and 2-3% constant usage of CPU with 7GB of RAM used.
And that's running a single container that uses 0-1% of CPU and 1GB of RAM.

I do appreciate improvements to DD when it's idle (e.g. not running any containers) but in such case I can just quit it and get an even better improvement by doing so. More important is reducing resources consumption above what's used by the containers.

@groogiam
Copy link

DD backend is constantly using 14-15 % of the cpu even with no containers running on Windows 10.

@j-bs
Copy link

j-bs commented Aug 27, 2024

I was suffering with consistent CPU usage from DD and containers that became slow to the point of useless but I'm seeing a complete turnaround after disabling analytics and auto update. I use pi-hole on my network which was suggested by someone else to cause the issues with analytics.

I also had to make changes to my qBittorrent container to fix some performance regressions there. I reduced the number of IO threads and also significantly reduced the amount of tracker announces that can happen. The latter was only required because of repeated timeouts/unreachable hosts, which would cause a large constant stream of failing announces.

I'm quite relieved because up until this point my docker containers would slowly degrade over a period of 1-2 days before becoming basically unusable -- I have a smokeping container running and the latency for websites would explode from normal to literally off the charts over this period of degradation.

I spent a lot of time researching and failing to find other fixes for my performance and networking issues to no avail. Things like MTU packet size discrepancy or enabling the forwarding flag for network adapters were not the silver bullet.

Hopefully those extra detail will help others with some keyword searches to find the fix they need 🙂

@hakito
Copy link

hakito commented Sep 15, 2024

This makes no sense to me. No container is running and docker eats almost all CPU from 8 Cores with 4.18 GHz

image

@AdelForplikter
Copy link

I was experiencing this same issue on Windows 10 Pro: perpetual ~30% CPU utilization despite no containers running. I'm running Docker Desktop 4.5.1 (74721) currently but saw it happening on 4.5.0 earlier today and hoped that updating to 4.5.1 would fix it. It did not.

How I eventually fixed it: I disabled "Automatically check for updates" and manually closed and restarted Docker Desktop. Now Docker Desktop is utilizing around 0% to 1% CPU.

I hope this fixes the issue for others, too.

It did. Sure devs must be aware of this issue now. Fans went from a few days of being crazy to normal again after removing "Automatically check for updates"

@pletnes
Copy link

pletnes commented Sep 18, 2024

The high CPU issue (at this point, I believe there must be several) is also present with automatic updates disabled. In general, there seems to be bugs causing 100% CPU "hangups" in docker desktop.

@ctalledo
Copy link

ctalledo commented Oct 8, 2024

Hi folks, Cesar Talledo from Docker here.

@groogiam, @hakito, @AdelForplikter, @pletnes: thanks for reporting, but if possible please help us further by uploading a Docker Desktop diagnostics bundle so we can investigate further.

I am not able to reproduce the Docker Desktop high CPU utilization when idle; on my Windows 11 machine, with Docker Desktop 4.34.2 configured with WSL, CPU utilization is close to 0% when idle, and mem utilization is ~200MB for the Docker Desktop app, plus ~2.1GB for the WSL VM (inside of which the Docker Engine runs):

Image

The utilization remains unchanged with "Automatic Updates" disabled or enabled (I tried with both Docker Desktop 4.34.2 and 4.32).

The mem utilization for the WSL VM (i.e., ~2.1GB) is mostly due to WSL itself. For example, if I quit Docker Desktop but keep my Ubuntu-22.04 WSL distro running, then WSL mem utilization drops by ~800MB, but stays at ~1.3GB. In other words, the Docker Desktop VM adds ~800MB as it contains the Docker Engine, containerd, and a bunch of other services around them.

Note that with WSL, over time the mem utilization of the WSL VM (the Vmmem process) can increase as the Linux kernel inside the VM populates its kernel cache. To improve things, I recommend to add the autoMemReclaim setting to the <USERNAME>\.wslconfig file:

[experimental]
autoMemoryReclaim="gradual"

This will cause WSL to gradually reclaim unused memory from the WSL VM and give it back on the host.

Also, note that the Docker Desktop resource saver feature, which automatically turns of the Docker Desktop VM when idle, does not work as well with WSL because it does not turn off the WSL VM (because the same VM is shared by all WSL distros, and other WSL distros could be running on it). Instead, it just pauses all processes inside the docker-desktop WSL distro, which reduces CPU utilization, but does not reduce mem utilization. This is different in Docker Desktop with Hyper-V, because in this case Docker Desktop can fully turn off the hyper-v VM when idle, reducing mem utilization by ~2GBs.

Hope that helps!

@AdelForplikter
Copy link

Hi folks, Cesar Talledo from Docker here.

@groogiam, @hakito, @AdelForplikter, @pletnes: thanks for reporting, but if possible please help us further by uploading a Docker Desktop diagnostics bundle so we can investigate further.

Of course. Diagnostics ID: B35684C4-5F67-424B-A3D8-ECAF724259C1/20241009065905

I undid the changes, but now I'm not able to replicate the issue either. I'll update if anything changes.

@pletnes
Copy link

pletnes commented Oct 9, 2024

In my experience, I get 100% CPU on all 20 cores, and my machine grinds to a halt. It happens less frequently after the auto-idle feature came. I also now turn of Docker Desktop as much as I can, to avoid this from happening. Sometimes I can recover with wsl --shutdown; other times, only a real reboot is sufficient.

I have enough RAM that I never was bothered memory-wise.

Do you want diagnostics collected exactly when the bug occurs, if still relevant?

@ctalledo
Copy link

ctalledo commented Oct 9, 2024

Thanks @pletnes for the response, so strange that you are seeing such high CPU utilization.

Do you want diagnostics collected exactly when the bug occurs, if still relevant?

Ideally yes, but if it's not possible try collecting them after stopping Docker Desktop.

Thanks!

@pletnes
Copy link

pletnes commented Oct 29, 2024

@ctalledo - here it is: 01B48E6C-558C-4A71-84A9-BA3D4462B367/20241029102633

100% CPU on all 20 cores, but RAM usage is just fine. I am not running any containers I'm aware of. docker ps just hangs.

Image

I also have colleagues who experience very similar symptoms so it's not just me.

Sometimes I can successfully shut down docker desktop to remove the problem; other times, I need a full reboot or even "hard reset" / pull the power.

@groogiam
Copy link

@ctalledo This happened again today after updating docker then exporting / importing a couple volumes.

Diagnostic Id: 9E30F2EC-BF93-435D-B367-6E1C5D9468E4/20241029162843

Image

@Bilge
Copy link

Bilge commented Nov 13, 2024

This is unacceptable and unresolvable. No containers running. Restarting Docker Desktop does not help. Shutting down WSL does not help. com.docker.backend.exe is perpetually burning eight silicon cores to accomplish nothing.

Image

I tried killing the process, but now I can't even (re)start Docker Desktop (I completely broke Docker).

@corwestermaniddink
Copy link

@Bilge @groogiam @pletnes I have only this issue on Windows 11, when I hibernated and coming back out of hibernation. Maby something to check on.

@hakito
Copy link

hakito commented Nov 13, 2024

I am Win10. So it's not Win11 specific

@Bilge
Copy link

Bilge commented Nov 13, 2024

@Bilge @groogiam @pletnes I have only this issue on Windows 11, when I hibernated and coming back out of hibernation. Maby something to check on.

I recently upgraded to Win 11 and just woke up my machine from sleep (not hibernation). You may be onto something. I often had this problem on a Windows 10 laptop also, but never on my desktop prior to upgrading to W11.

@ctalledo
Copy link

ctalledo commented Nov 13, 2024

@ctalledo - here it is: 01B48E6C-558C-4A71-84A9-BA3D4462B367/20241029102633

100% CPU on all 20 cores, but RAM usage is just fine. I am not running any containers I'm aware of. docker ps just hangs.

Image

I also have colleagues who experience very similar symptoms so it's not just me.

Sometimes I can successfully shut down docker desktop to remove the problem; other times, I need a full reboot or even "hard reset" / pull the power.

Hi @pletnes, thanks for uploading the diagnostics bundle.

I can see the very high CPU usage in the diagnostics, and it's coming from the WSL VM (aka vmmem) as you showed. It's not coming from the Docker Desktop processes in the Windows host itself.

Unfortunately I was not able to determine which process(es) inside the WSL VM are causing the high CPU consumption because the VM seems to be hung-up (i.e., the diagnostics gatherer timed-out while trying to collect that info inside the WSL VM).

There are 3 WSL distros in your setup: docker-desktop, docker-desktop-data, and Ubuntu-22.04. Any of those could be causing the high CPU consumption (or maybe none of those, maybe it's a WSL hypervisor bug).

Question: when you stop Docker Desktop but keep the Ubuntu-22.04 WSL distro running, does the CPU consumption go back to normal?

@dubeg
Copy link

dubeg commented Nov 13, 2024

@ctalledo Are you aware of this thread? carlfriedrich/wsl-kernel-build#1
The latest update from it is...

Yes, there's now some specific action underway from the Microsoft folks to provide a resolution. I have suggested that they might want to update this thread and the WSL Issue #6982 thread when they are ready, which will hopefully be in the next few weeks.

From the same author in the 6982 thread:

Let me provide a high-level recap on this long thread. :-) It has many reports of high CPU usage on the Windows/Hyper-V host, and hangs in the WSL Linux VM. For the most part, the reported symptoms are somewhat generic, which is a starting point, but usually doesn't help get to the root cause. That said, we have gotten enough diagnostic details to identify one root cause, but there may be other root causes that produce the same generic symptoms. Here are the details of the known root cause...

@ctalledo
Copy link

@ctalledo Are you aware of this thread? carlfriedrich/wsl-kernel-build#1 The latest update from it is...

Thanks @dubeg! That could very well explain the behavior reported in this issue by many users, particularly those experiencing the problem after Windows comes out of hibernation.

@ctalledo
Copy link

@ctalledo This happened again today after updating docker then exporting / importing a couple volumes.

Hi @groogiam, thanks for uploading the diagnostics bundle. Your report seems different than most of the other comments in this issue. I looked at the logs but could not determine the cause of the high CPU usage (seems at the time the diagnostics bundle was taken, the CPU usage was already lower, ~12%). Curious if the problem is reproducible, and if Docker Desktop stays at that high CPU utilization or if it goes back to normal after a while.

@groogiam
Copy link

@ctalledo This happened again today after updating docker then exporting / importing a couple volumes.

Hi @groogiam, thanks for uploading the diagnostics bundle. Your report seems different than most of the other comments in this issue. I looked at the logs but could not determine the cause of the high CPU usage (seems at the time the diagnostics bundle was taken, the CPU usage was already lower, ~12%). Curious if the problem is reproducible, and if Docker Desktop stays at that high CPU utilization or if it goes back to normal after a while.

@ctalledo When I was watching it via the task manager it was hovering around 50% as per the screenshot. This happens very sporadically for me. When it happens the docker process seems to get stuck at ~50% and from what I can tell does not go back to normal. Restarting wsl and docker seems to alleviate the issue though.

@ctalledo
Copy link

FYI, can't repro on my Windows laptop with Docker Desktop running, coming in/out of hibernation multiple times (i.e., CPU utilization remains < 10% for Docker Desktop).

Windows 11 Pro
Docker Desktop 4.35.1
WSL version: 2.3.26.0
Kernel version: 5.15.167.4-1

@ctalledo
Copy link

@pletnes,

I noticed you have WSL 2.3.24.0, with kernel version 5.15.153.1-2, which apparently has the WSL hibernation bug (see table in the first comment). Please try with a newer WSL version and kernel and check if it reproduces.

Thanks!

@ctalledo
Copy link

@ctalledo When I was watching it via the task manager it was hovering around 50% as per the screenshot. This happens very sporadically for me. When it happens the docker process seems to get stuck at ~50% and from what I can tell does not go back to normal. Restarting wsl and docker seems to alleviate the issue though.

Thanks again @groogiam; there are prior comments in this issue where the Docker Desktop backend shows high CPU utilization, which is unexpected.

When it occurs, are you running containers or is Docker Desktop idle?

@pletnes
Copy link

pletnes commented Nov 15, 2024

@pletnes,

I noticed you have WSL 2.3.24.0, with kernel version 5.15.153.1-2, which apparently has the WSL hibernation bug (see table in the first comment). Please try with a newer WSL version and kernel and check if it reproduces.

Great idea! However...

$ wsl --update
Checking for updates.
The most recent version of Windows Subsystem for Linux is already installed.

I also had this bug before I installed the ubuntu WSL. I don't use that (or very, very rarely)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests