docker / for-mac

Bug reports for Docker Desktop for Mac
https://www.docker.com/products/docker#/mac
2.43k stars 118 forks source link

com.docker.hyperkit 100% cpu usage #5905

Open ddzobov opened 3 years ago

ddzobov commented 3 years ago

5894

735E4E6C-F507-4172-9F91-96A5E8186742/20210812115235

Now i'm upgraded to latest 3.6.0, problem not solved. I've tried to restore factory settings, nothing helped.

Снимок экрана 2021-08-12 в 15 11 55 Снимок экрана 2021-08-12 в 15 20 30 Снимок экрана 2021-08-12 в 15 20 49
jasonglisson commented 3 years ago

This has been an issue for a long time it seems like. My Mac can't charge fast enough to counteract Docker draining my battery. CPU is sitting at 99.5% for Docker.

dimaqq commented 3 years ago

I can confirm this, but I think I've only started experiencing this after upgrading to newest versions:

Power adaptor plugged in, Resources to their minimum (1vCPU, 2GB ram, .5GB swap):

In short, user experience for the default install is quite bad.

In the interim, it helps to install Turbo Boost Switcher (free), and "disable" turbo boost. That brings the CPU junction temp down from 98C 🥵 to 75C 🤒 Ofc, that also slows down your mac, maybe by 2x, so YMMV.

Algatux commented 3 years ago

Same here, this is my Diagnostic Data ID -> B098CCBB-1EEC-45D2-8112-27109348927E/20210817123229

ddzobov commented 3 years ago

Any updates here? Docker for mac currently unusable...

i think that there is an issue with volume mounts.

james-blitzm commented 3 years ago

In addition to the above, I've observed the idle CPU usage of Docker on MacOS to be consistently 40%-50%. Output snippet from top is here:

Screen Shot 2021-08-30 at 4 10 50 pm

I currently have only 4 containers running and docker stats tells me each of those is consistently only around 1% of CPU:

Screen Shot 2021-08-30 at 4 10 37 pm

Should I raise this as a distinct issue? Is this the expected baseline CPU usage for Docker on MacOS?

iongion commented 3 years ago

Using latest docker for mac as of today, Intel macbook pro i7, same issue, I can barely touch my functional keys due to heat, CPU temperature is 110 deg C and shows 200% usage.

If I run a Virtualbox VM with linux, where I install docker, all is at 30%, it is a full blown xubuntu 20.04 desktop

Is there nothing we can do, no mittigation/tip ?

dimaqq commented 3 years ago

I was hoping that paying money to Docker, inc. would help. But alas, the new Docker Desktop update for macOS that asks you to accept new terms (where, essentially, SME's have to pay, too) doesn't solve this problem. 🤷🏿‍♂️ 🤷🏿‍♀️ 🤷🏿

dimaqq commented 3 years ago

Possible cause: #5940 (may depend on what virtualisation mechanism OP used)

iongion commented 3 years ago

I've tried all docker engines available, same problem all the time

image

returned to this image

My docker containers are not doing anything, just an apache server waiting plus mysql

Found a mitigation, using free smcFanControl at full blast mode to prevent the CPU from going above 100C

image

dimaqq commented 3 years ago

Here's my diagnostic ID: E3B4D178-F82A-45E4-9B5D-A3C288439479/20210908075810

Can the admins add version/4.0.0 tag also, please?

ddzobov commented 3 years ago

Yes, same issue with 4.0.0

4470E8C6-FA81-48BE-9895-3F521651C2AB/20210908211800

iongion commented 3 years ago

Are you guys all on Big Sur ? Could this be a MacOS problem more than Docker ?

jasonglisson commented 3 years ago

I've had this problem for over a year on several different devices. I have a Macbook on High Sierra with this problem, and my newer laptop with Big Sur also has this same issue. It could be a Mac issue, but its is across multiple operating systems for sure.

On Thu, Sep 9, 2021 at 10:27 AM Ionut Stoica @.***> wrote:

Are you guys all on Big Sur ? Could this be a MacOS problem more than Docker ?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/docker/for-mac/issues/5905#issuecomment-916149244, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABA3PG57H6VJ5F5ICCMR6RLUBC74BANCNFSM5CBBU7SA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

-- Jason Glisson www.jasonglisson.com Custom Web Development Drupal | WordPress | Ecommerce

xavipanda commented 3 years ago

https://github.com/docker/for-mac/issues?q=is%3Aissue+is%3Aopen+cpu Dozen and dozen of created Issues... happening for 1Y~+, no action. Docker is more busy defining a license for docker mac.. but not fixing this problem that turns the laptop into a overheating-noisy machine..

james-blitzm commented 3 years ago

The only workaround that works for me is exiting Docker when I'm not using it.

dimaqq commented 3 years ago

Are you guys all on Big Sur ? Could this be a MacOS problem more than Docker ?

I am on Big Sur, however, Docker for Mac used to be OK for me on Big Sur before. I can't be certain which of the two updates was critical, the issue started for me with these versions:

djmcgreal-cc commented 3 years ago

Catalina 10.15.7 (19H524)

djmcgreal-cc commented 3 years ago

Dozen and dozen of created Issues... happening for 1Y~+, no action. Docker is more busy defining a license for docker mac.. but not fixing this problem that turns the laptop into a overheating-noisy machine..

This is now making us take steps towards podman and its friends.

iongion commented 3 years ago

We can also consider it the other way around, if they dont have the resources to dedicate, they will need them first by raising money.

Docker is still the most well documented tech there is in this regard, many of us invested a lot in it and is not like we can shift overnight.

On Fri, 10 Sep 2021, 13:24 djmcgreal-cc, @.***> wrote:

Dozen and dozen of created Issues... happening for 1Y~+, no action. Docker is more busy defining a license for docker mac.. but not fixing this problem that turns the laptop into a overheating-noisy machine..

This is now making us take steps towards podman and its friends.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/docker/for-mac/issues/5905#issuecomment-916798858, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGT2GKDTGUAPNLUVUDIWPTUBHMENANCNFSM5CBBU7SA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

iongion commented 3 years ago

A more detailed report, maybe of any help

NOTE - 45001 wakeups over the last 40 seconds (1119 wakeups per second average), exceeding limit of 150 wakeups per second over 300 seconds

Date/Time:        2021-09-10 14:44:11.294 +0300
End time:         2021-09-10 14:44:51.494 +0300
OS Version:       macOS 11.5.2 (Build 20G95)
Architecture:     x86_64h
Report Version:   32
Incident Identifier: 0F4BA383-C081-4CC6-BAE6-8E3E08F9EA38

Data Source:      Microstackshots
Shared Cache:     0C9EB0DE-F5CE-3AFC-8F08-0C6DB1E7FC44 slid base address 0x7fff2014b000, slide 0x14b000

Command:          com.docker.hyperkit
Path:             /Applications/Docker.app/Contents/Resources/bin/com.docker.hyperkit
Version:          ??? (???)
Parent:           UNKNOWN [1977]
PID:              1979

Event:            wakeups
Action taken:     none
Wakeups:          45001 wakeups over the last 40 seconds (1119 wakeups per second average), exceeding limit of 150 wakeups per second over 300 seconds
Wakeups limit:    45000
Limit duration:   300s
Wakeups caused:   45001
Wakeups duration: 40s
Duration:         40.20s
Duration Sampled: 2.00s
Steps:            3

Hardware model:   MacBookPro11,3
Active cpus:      8

Fan speed:        2546 rpm

Heaviest stack for the target process:
  3  thread_start + 15 (libsystem_pthread.dylib + 9283) [0x7fff20455443]
  3  _pthread_start + 224 (libsystem_pthread.dylib + 26876) [0x7fff204598fc]
  3  vcpu_thread + 1586 (com.docker.hyperkit + 2252739) [0x108f69fc3]
  3  vcpu_loop + 196 (com.docker.hyperkit + 2253247) [0x108f6a1bf]
  2  xh_vm_run + 346 (com.docker.hyperkit + 2139317) [0x108f4e4b5]
  2  vmx_run + 1730 (com.docker.hyperkit + 2102676) [0x108f45594]
  2  hv_vcpu_run + 31 (Hypervisor + 13533) [0x7fff6ea8b4dd]

Powerstats for:   com.docker.hyperkit [1979]
UUID:             A987D5D6-9E33-3973-9100-68E208725800
Path:             /Applications/Docker.app/Contents/Resources/bin/com.docker.hyperkit
Architecture:     x86_64
Parent:           UNKNOWN [1977]
UID:              501
Footprint:        8568.14 MB
Pageins:          1 pages
Start time:       2021-09-10 14:44:47.708 +0300
End time:         2021-09-10 14:44:49.709 +0300
Num samples:      3 (100%)
Primary state:    2 samples Non-Frontmost App, Non-Suppressed, Kernel mode, Effective Thread QoS Default, Requested Thread QoS Default, Override Thread QoS Unspecified
User Activity:    0 samples Idle, 3 samples Active
Power Source:     0 samples on Battery, 3 samples on AC
  3  thread_start + 15 (libsystem_pthread.dylib + 9283) [0x7fff20455443]
    3  _pthread_start + 224 (libsystem_pthread.dylib + 26876) [0x7fff204598fc]
      3  vcpu_thread + 1586 (com.docker.hyperkit + 2252739) [0x108f69fc3]
        3  vcpu_loop + 196 (com.docker.hyperkit + 2253247) [0x108f6a1bf]
          2  xh_vm_run + 346 (com.docker.hyperkit + 2139317) [0x108f4e4b5]
            2  vmx_run + 1730 (com.docker.hyperkit + 2102676) [0x108f45594]
              2  hv_vcpu_run + 31 (Hypervisor + 13533) [0x7fff6ea8b4dd]
          1  xh_vm_run + 1565 (com.docker.hyperkit + 2140536) [0x108f4e978]
            1  vm_copy_setup + 128 (com.docker.hyperkit + 2137230) [0x108f4dc8e]
              1  vm_gla2gpa + 601 (com.docker.hyperkit + 2153882) [0x108f51d9a]
                1  <User mode>

  Binary Images:
           0x108d44000 -        0x1093a1fff  com.docker.hyperkit (0)             <A987D5D6-9E33-3973-9100-68E208725800>  /Applications/Docker.app/Contents/Resources/bin/com.docker.hyperkit
        0x7fff20453000 -     0x7fff2045efff  libsystem_pthread.dylib (454.120.2) <B1A74420-49E9-32FC-BFCB-E53550236A23>  /usr/lib/system/libsystem_pthread.dylib
        0x7fff6ea88000 -     0x7fff6ea8ffff  com.apple.Hypervisor 1.0 (1)        <70A1C6EB-F01F-34CC-8DC0-E642A75CE47C>  /System/Library/Frameworks/Hypervisor.framework/Versions/A/Hypervisor
ddzobov commented 3 years ago

Guys, please reply something to us

ddzobov commented 3 years ago

4.0.1 - same issue

leimantas commented 3 years ago

No one cares :)

dimaqq commented 2 years ago

🎉 Things are better with docker desktop 4.1.0 (69386) engine 20.10.8 🎉

I'm now at 50% CPU use with 6 idle containers, which is a clear improvement from 100% CPU use!

The CPU temp and fan speed is still high with default settings (93C, 6Krpm), so I still need to disable turbo boost (or similar utility) to the laptop sane (67C, 4Krpm).

Thank you everyone who asked their paying employers, etc., to nag Docker Inc. to start fixing this!

ddzobov commented 2 years ago

Nothing changed for me at 4.1.0 (69386)

🎉 Things are better with docker desktop 4.1.0 (69386) engine 20.10.8 🎉

I'm now at 50% CPU use with 6 idle containers, which is a clear improvement from 100% CPU use!

The CPU temp and fan speed is still high with default settings (93C, 6Krpm), so I still need to disable turbo boost (or similar utility) to the laptop sane (67C, 4Krpm).

Thank you everyone who asked their paying employers, etc., to nag Docker Inc. to start fixing this!

Снимок экрана 2021-10-04 в 10 09 47
leimantas commented 2 years ago

Nothing changed for me at 4.1.0 (69386)

🎉 Things are better with docker desktop 4.1.0 (69386) engine 20.10.8 🎉 I'm now at 50% CPU use with 6 idle containers, which is a clear improvement from 100% CPU use! The CPU temp and fan speed is still high with default settings (93C, 6Krpm), so I still need to disable turbo boost (or similar utility) to the laptop sane (67C, 4Krpm). Thank you everyone who asked their paying employers, etc., to nag Docker Inc. to start fixing this!

Снимок экрана 2021-10-04 в 10 09 47

Tested. Over 300% cpu with NODE v16 + simple NEXTJS app on yarn build. when idle - seems ok. But when trying to do something - gets over 200% cpu.

bkawula commented 2 years ago

Not sure if it helps, but when using a javascript framework that has some sort of live refresh / reload feature you should check to see what your polling time is set to. I was trying to run an angular container and the cli was polling at 1ms which resulted in 300% CPU usage. Changing the time to 2000ms brought the CPU down to about 20-30%.

joshelson commented 2 years ago

Not that this seems likely to help, but I am sitting at basically two whole cores being used pretty much all the time for hyperkit on my Macbook 2019. This issue has persisted with Monterey (12.0.1) release as well as whether the new or experimental virtualization framework is being used.

gfviegas commented 2 years ago

image

I mean...

Docker for Mac is unusable just like it was some years ago

dimaqq commented 2 years ago

Today there's an update, 4.2.0 which promises to "save battery with pause/resume" functionality.

Meanwhile, a colleague reported that Docker for mac on M1 does not appear to suffer from ridiculous CPU usage, I think he reported <50% of one core, with a few containers running. Perhaps Docker Inc., is simply too busy preparing for new, armed macs?

leimantas commented 2 years ago

Today there's an update, 4.2.0 which promises to "save battery with pause/resume" functionality.

Meanwhile, a colleague reported that Docker for mac on M1 does not appear to suffer from ridiculous CPU usage, I think he reported <50% of one core, with a few containers running. Perhaps Docker Inc., is simply too busy preparing for new, armed macs?

sadly, nothing changed... Try to mount node_modules.

djmcgreal-cc commented 2 years ago

I had to abandon my docker workflow due to it using over 700% of my 8 core CPU. Actual containers were taking up around 30%

It would be very nice if someone with some insight could share what factors are keeping this seemingly major usability issue from receiving any perceptible attention.

bkawula commented 2 years ago
Screen Shot 2021-11-15 at 1 50 33 PM

This is my CPU usage with one container on a 2018 MacBook Pro running Big Sur and Docker Desktop 4.1.1

leimantas commented 2 years ago
Screen Shot 2021-11-15 at 1 50 33 PM

This is my CPU usage with one container on a 2018 MacBook Pro running Big Sur and Docker Desktop 4.1.1

Try to work ;) not just watch idle.

bkawula commented 2 years ago

It spikes to around 40% if I do anything with my web app. Builds will push it past 100%, but that happens even when I run my code locally outside of docker.

leimantas commented 2 years ago

It spikes to around 40% if I do anything with my web app. Builds will push it past 100%, but that happens even when I run my code locally outside of docker.

Mount your code. Edit it. Not just play with app. But edit some code. And yes, when I just play with app in browser, CPU is not so high. Problems are with mounted folders, whet it syncs container - native.

jarredwitt commented 2 years ago

Absolutely what @leimantas said. I now avoid mounting my react and go project folders so that I can actually work and not have to deal with >500% CPU usage. I run caddy to tie things together in my compose file and I’ve opted to just map ports directly to my host so I can avoid mounting folders in the containers.

dimaqq commented 2 years ago

https://github.com/docker/for-mac/issues/4323#issuecomment-930462399 recommends disabling buildkit gc. this kinda-almost-solves the issue when no containers are running (CPU usage down to 20~25% of one core).

when some containers are running and idling, sometimes it helps, and other times it doesn't. YMMV.

jarredwitt commented 2 years ago

Disabling the buildkit gc did help me somewhat. Docker now stays at a modest 40-50% CPU usage with occasional pops to 150% when containers are running whereas before it was running closer to 100% with occasional pops to 300%. If I'm compiling from a bind mounted folder then the CPU usage goes > 500%, but it does come back down once the build is done. For reference my compose file contains the following services:

Golang (REST API) - bind mounted folder Postgres - bind mounted folder Redis Inbucket Minio - bind mounted folder Caddy

jarredwitt commented 2 years ago

Just had a breakthrough on my machine that I hope helps someone else. I disabled the following:

image

And I have to say, docker is running incredibly well now. It hasn't gone over 50% CPU usage even when compiling my Go project. When not compiling it stays around 5% rarely popping up to 15% CPU usage. My laptop fans are finally quiet.

zyxkad commented 2 years ago

Just had a breakthrough on my machine that I hope helps someone else. I disabled the following:

image

And I have to say, docker is running incredibly well now. It hasn't gone over 50% CPU usage even when compiling my Go project. When not compiling it stays around 5% rarely popping up to 15% CPU usage. My laptop fans are finally quiet.

That's not working on my computer :(

zyxkad commented 2 years ago

I trying to use the self-diagnose-tool But it has a strange report

$ docker ps
CONTAINER ID   IMAGE     COMMAND   CREATED   STATUS    PORTS     NAMES
$ /Applications/Docker.app/Contents/MacOS/com.docker.diagnose check
Starting diagnostics

[PASS] DD0027: is there available disk space on the host?
[PASS] DD0028: is there available VM disk space?
[PASS] DD0031: does the Docker API work?
[PASS] DD0004: is the Docker engine running?
[PASS] DD0011: are the LinuxKit services running?
[FAIL] DD0016: is the LinuxKit VM running? vm is not running: vm has not started
[PASS] DD0001: is the application running?
[PASS] DD0018: does the host support virtualization?
[FAIL] DD0017: can a VM be started? vm has not started: vm has not started
[PASS] DD0015: are the binary symlinks installed?
[PASS] DD0003: is the Docker CLI working?
[PASS] DD0013: is the $PATH ok?
[PASS] DD0007: is the backend responding?
[PASS] DD0014: are the backend processes running?
[PASS] DD0008: is the native API responding?
[PASS] DD0009: is the vpnkit API responding?
[PASS] DD0010: is the Docker API proxy responding?
[PASS] DD0012: is the VM networking working?
[PASS] DD0032: do Docker networks overlap with host IPs?
[SKIP] DD0030: is the image access management authorized?
[PASS] DD0019: is the com.docker.vmnetd process responding?
[PASS] DD0033: does the host have Internet access?

Please investigate the following 1 issue:

1 : The test: can a VM be started?
    Failed with: vm has not started: vm has not started

The Docker engine runs inside a Linux VM. Therefore we must be able to start Virtual Machines.
zyxkad commented 2 years ago

That's my Diagnostics ID: 0BC24FE9-B455-4011-8C2F-340D67B05231/20220131140722

docker-robott commented 2 years ago

Issues go stale after 90 days of inactivity. Mark the issue as fresh with /remove-lifecycle stale comment. Stale issues will be closed after an additional 30 days of inactivity.

Prevent issues from auto-closing with an /lifecycle frozen comment.

If this issue is safe to close now please do so.

Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows. /lifecycle stale

sirvio commented 2 years ago

/remove-lifecycle stale

ramazanpolat commented 2 years ago

From 2017 to 2022... Still having the same problem!

1759 #3499 #5287

jpatricknola commented 2 years ago

Im having this problem as well, I have to pause docker to let my mac book recharge otherwise it drains the battery even while the charger is plugged in. Very inconvenient

s001dxp commented 2 years ago

Been experiencing this issue for years. When I start docker it slowly starts consuming CPU until it's maxed out. My apps run extremely slow.

Screen Shot 2022-08-01 at 12 08 45 AM

darvanen commented 2 years ago

Just started experiencing this, I didn't change any of the containers, just upgraded Docker and now my Mac is overheating.

alejgarciarodriguez commented 1 year ago

I've been experiencing huge cpu usage and battery draining since last update, 4.13, maybe before, but only with "new virtualization framework" and "virtioFS acceleared directory sharing" beta features enabled. (M1, 12.6)

When disabled everything backs to normal but this wasn't happening a few versions ago. Don't really know if my case is related to this issue but might can help someone.