for-win icon indicating copy to clipboard operation
for-win copied to clipboard

High CPU usage while Docker Desktop is running on Windows

Open wallyhall opened this issue 4 years ago • 195 comments

  • [x] I have tried with the latest version of Docker Desktop (have confirmed is still an issue on 4.1.1 since posting this issue)
  • [x] I have tried disabling enabled experimental features
  • [x] 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 https://github.com/docker/for-win/issues/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 https://github.com/docker/for-win/issues/6947#issuecomment-941089810

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 avatar Oct 12 '21 15:10 wallyhall

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

wallyhall avatar Oct 12 '21 16:10 wallyhall

https://github.com/docker/for-win/issues/2854 - 2018, stale, locked https://github.com/docker/for-win/issues/3811 - 2019, stale, locked https://github.com/docker/for-win/issues/4773 - 2019, stale, locked https://github.com/docker/for-win/issues/4977 - 2019, stale, locked https://github.com/docker/for-win/issues/6947 - 2020, stale, locked https://github.com/docker/for-win/issues/8742 - 2020 https://github.com/docker/for-win/issues/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.

vladimmi avatar Nov 25 '21 12:11 vladimmi

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

jibbers42 avatar Dec 27 '21 19:12 jibbers42

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 :-(

ColinPM avatar Feb 25 '22 20:02 ColinPM

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.

bill-finlay-ssd avatar Mar 02 '22 22:03 bill-finlay-ssd

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

bn-s avatar Mar 05 '22 17:03 bn-s

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.

Raton-Laveur avatar Apr 06 '22 10:04 Raton-Laveur

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.

b-hayes avatar Apr 13 '22 01:04 b-hayes

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

seeker avatar Apr 19 '22 08:04 seeker

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

fernando2amigos avatar Apr 20 '22 15:04 fernando2amigos

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.

vladimmi avatar Apr 20 '22 16:04 vladimmi

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

same for 4.7.1 (77678)

vash1486 avatar Apr 23 '22 13:04 vash1486

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

perclausen avatar Apr 24 '22 21:04 perclausen

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%.

Firsh avatar Apr 25 '22 15:04 Firsh

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

perclausen avatar Apr 26 '22 15:04 perclausen

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...

enr1424 avatar Apr 26 '22 16:04 enr1424

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

Mr1008 avatar Apr 28 '22 11:04 Mr1008

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!

arturoarevalo avatar Apr 28 '22 14:04 arturoarevalo

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

Firsh avatar May 01 '22 11:05 Firsh

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.

maffe avatar May 02 '22 11:05 maffe

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.

briantist avatar May 05 '22 17:05 briantist

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

ahem

wallyhall avatar May 05 '22 18:05 wallyhall

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 :)

hacklschorsch avatar May 06 '22 11:05 hacklschorsch

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

TimGels avatar May 07 '22 17:05 TimGels

@TimGels please check if this helps https://github.com/docker/for-win/issues/12266#issuecomment-1112117020

Mr1008 avatar May 07 '22 18:05 Mr1008

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.

daniel-liuzzi avatar May 07 '22 18:05 daniel-liuzzi

@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.

TimGels avatar May 07 '22 18:05 TimGels

@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.

Mr1008 avatar May 08 '22 17:05 Mr1008

@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.

I will try it out sometime when I can. Thank you for the suggestion!

TimGels avatar May 08 '22 18:05 TimGels

Disabling Automatically check for updates seems to fix the issue on my system (Windows 10 Pro 21H2), I launch containers from inside WSL2 (Ubuntu 20.04)

bayasdev avatar May 10 '22 03:05 bayasdev