-
Notifications
You must be signed in to change notification settings - Fork 288
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
Comments
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. |
#2854 - 2018, stale, locked 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. |
Shame I didn't get any coal for Christmas, I could have used it to help power my Vmmem... |
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 :-( |
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
|
Same behavior with 4.6.1, same fix still works. |
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. 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. |
The issue is still present in Docker Desktop 4.7.0 (77141), workaround still works. |
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. |
same for 4.7.1 (77678) |
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%. |
Delete ~/.docker and check if it helps. Resetting and cleaning/purging did not help in my case but deleting this folder helped immediately |
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! |
I ended up uninstalling, then putting Docker inside WSL. Much better (and slimmer) experience. The GUI is now Portainer. |
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.
Sample stacktraces:
The process with the high CPU usage uses only a small amount of RAM, about 10 MB. |
Suddenly had this start happening today (no containers running) after upgrading to 4.7.1 (77678). I never experienced it before. Deleting |
Maybe the changes to the license agreement on Docker Desktop was to raise funds to fix this bug. ahem |
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:
I had a couple of (shut down) Containers with a shared Volume in a folder that did not exist anymore. Ever since my laptop has been quiet again, much to the relief of my office mates :) |
@TimGels please check if this helps #12266 (comment) |
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 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. |
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. |
Now I have thousands of com.docker.cli.exe processes running. |
Disable auto checking update works. The issue still happening today |
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. 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. |
DD backend is constantly using 14-15 % of the cpu even with no containers running on Windows 10. |
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 Hopefully those extra detail will help others with some keyword searches to find the fix they need 🙂 |
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" |
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. |
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): 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
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 Hope that helps! |
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. |
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 I have enough RAM that I never was bothered memory-wise. Do you want diagnostics collected exactly when the bug occurs, if still relevant? |
Thanks @pletnes for the response, so strange that you are seeing such high CPU utilization.
Ideally yes, but if it's not possible try collecting them after stopping Docker Desktop. Thanks! |
@ctalledo - here it is: 100% CPU on all 20 cores, but RAM usage is just fine. I am not running any containers I'm aware of. 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. |
@ctalledo This happened again today after updating docker then exporting / importing a couple volumes. Diagnostic Id: 9E30F2EC-BF93-435D-B367-6E1C5D9468E4/20241029162843 |
This is unacceptable and unresolvable. No containers running. Restarting Docker Desktop does not help. Shutting down WSL does not help. I tried killing the process, but now I can't even (re)start Docker Desktop (I completely broke Docker). |
I am Win10. So it's not Win11 specific |
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. |
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? |
@ctalledo Are you aware of this thread? carlfriedrich/wsl-kernel-build#1
From the same author in the 6982 thread:
|
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. |
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. |
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 |
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! |
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? |
Great idea! However...
I also had this bug before I installed the ubuntu WSL. I don't use that (or very, very rarely) |
Actual behavior
As per original issue:
(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:
Information
Steps to reproduce the behavior
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.
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).
The text was updated successfully, but these errors were encountered: