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

com.docker.hyperkit 100% cpu usage #5905

Open
ddzobov opened this issue Aug 12, 2021 · 61 comments
Open

com.docker.hyperkit 100% cpu usage #5905

ddzobov opened this issue Aug 12, 2021 · 61 comments

Comments

@ddzobov
Copy link

ddzobov commented Aug 12, 2021

#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
Copy link

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
Copy link

dimaqq commented Aug 17, 2021

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

  • macOS Big Sur 11.5.2
  • docker desktop 3.6.0 (67351) engine 20.10.8

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

  • with no containers running, com.apple.Virtualization.VirtualMachine consistently uses 25% of a CPU core (UX: OK-ish)
  • with 5 mostly idle containers (docker stats: 0.00% ~ 2.xx%), VM consistently uses 50% of a CPU core (UX: noisy fans)
  • with more resources (2vCPU), same 5 mostly idle containers, VM uses 100% of a CPU core (UX: hot laptop)

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
Copy link

Algatux commented Aug 17, 2021

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

@ddzobov
Copy link
Author

ddzobov commented Aug 19, 2021

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

i think that there is an issue with volume mounts.

@james-blitzm
Copy link

james-blitzm commented Aug 30, 2021

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
Copy link

iongion commented Sep 2, 2021

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
Copy link

dimaqq commented Sep 2, 2021

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
Copy link

dimaqq commented Sep 3, 2021

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

@iongion
Copy link

iongion commented Sep 6, 2021

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
Copy link

dimaqq commented Sep 8, 2021

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

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

@ddzobov
Copy link
Author

ddzobov commented Sep 8, 2021

Yes, same issue with 4.0.0

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

@iongion
Copy link

iongion commented Sep 9, 2021

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

@jasonglisson
Copy link

jasonglisson commented Sep 9, 2021 via email

@xavipanda
Copy link

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
Copy link

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

@dimaqq
Copy link

dimaqq commented Sep 10, 2021

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:

  • macOS Big Sur 11.5.2
  • docker desktop 3.6.0 (67351) engine 20.10.8

@djmcgreal-cc
Copy link

Catalina 10.15.7 (19H524)

@djmcgreal-cc
Copy link

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
Copy link

iongion commented Sep 10, 2021 via email

@iongion
Copy link

iongion commented Sep 10, 2021

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
Copy link
Author

ddzobov commented Sep 15, 2021

Guys, please reply something to us

@ddzobov
Copy link
Author

ddzobov commented Sep 16, 2021

4.0.1 - same issue

@leimantas
Copy link

No one cares :)

@dimaqq
Copy link

dimaqq commented Oct 4, 2021

🎉 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
Copy link
Author

ddzobov commented Oct 4, 2021

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

@dimaqq
Copy link

dimaqq commented Nov 27, 2021

#4323 (comment) 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
Copy link

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
Copy link

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
Copy link

zyxkad commented Jan 31, 2022

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
Copy link

zyxkad commented Jan 31, 2022

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
Copy link

zyxkad commented Jan 31, 2022

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

@docker-robott
Copy link
Collaborator

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
Copy link

sirvio commented May 5, 2022

/remove-lifecycle stale

@ramazanpolat
Copy link

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

#1759 #3499 #5287

@jpatricknola
Copy link

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
Copy link

s001dxp commented Aug 1, 2022

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
Copy link

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

@alejgr
Copy link

alejgr commented Oct 20, 2022

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.

@dimaqq
Copy link

dimaqq commented Oct 21, 2022

I now work for a different company than I did in 2021 and posted my last comment.
In this company, engineers' laptops run Linux.
For some, the requirement has to do with our stack.
Others, e.g. front-end developers could be using macOS, except for a few Docker nits.
This is one of those nits, a big one.

@thSoft
Copy link

thSoft commented Nov 30, 2022

I can also reproduce this bug: my fans are spinning at maximum speed when running Docker Desktop. Details:

  • macOS 11.6.7
  • Docker Desktop 4.14.1
  • Settings:
    • General > Use Virtualization framework: disabled
    • Beta Features > Enable VirtioFS accelerated directory sharing: disabled
  • CPU usage: com.docker.hyperkit 115,5

@docker-robott
Copy link
Collaborator

There hasn't been any activity on this issue for a long time.
If the problem is still relevant, mark the issue as fresh with a /remove-lifecycle stale comment.
If not, this issue will be closed in 30 days.

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

/lifecycle stale

@jean-maxime
Copy link

I have the same issue with my mac since the beginning
macOS Ventura 13.21.1
Docker desktop 4.17.0

I try every solution but nothing changes :/

@jean-maxime
Copy link

/remove-lifecycle stale

@mf-nz
Copy link

mf-nz commented Mar 22, 2023

I encountered this issue, but found a workaround - Running Docker without Docker Desktop

@krstp
Copy link

krstp commented Apr 24, 2023

/lifecycle frozen

@jaxsong
Copy link

jaxsong commented May 22, 2023

@krstp
Copy link

krstp commented May 28, 2023

ATM on M2 doesn't seem to be causing any issues, but on my "old" Intel won't help. Note, there are no containers running, but it will continue running this process generally indefinitely.
fume

@mianbilalashraf
Copy link

This worked for me 😌
#4323 (comment)

@garybrowne
Copy link

A lot of great technical suggestions here, and this is going to sound #lame but a quick docker system prune did the trick for me

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