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 Utilization of Hyperkit in Mac #1759

Closed
taufek opened this issue Jun 21, 2017 · 544 comments
Closed

High CPU Utilization of Hyperkit in Mac #1759

taufek opened this issue Jun 21, 2017 · 544 comments

Comments

@taufek
Copy link

@taufek taufek commented Jun 21, 2017

My CPU utilization by hyperkit on my mac seems too high. It caused my mac to overheat.

screen shot 2017-06-21 at 1 04 44 pm

Below is my docker version info:

╰─ docker version                                                                                                                                                                                                  13:06:29
Client:
 Version:      17.06.0-ce-rc4
 API version:  1.30
 Go version:   go1.8.3
 Git commit:   29fcd5d
 Built:        Thu Jun 15 17:29:01 2017
 OS/Arch:      darwin/amd64

Server:
 Version:      17.06.0-ce-rc4
 API version:  1.30 (minimum version 1.12)
 Go version:   go1.8.3
 Git commit:   29fcd5dfae
 Built:        Thu Jun 15 18:50:07 2017
 OS/Arch:      linux/amd64
 Experimental: true

Below is my diagnostic id when this issue is happening.
1B8B3901-6393-41B7-B7D3-0FC914F1C668

I'm running rails container with docker-sync.

@jwulf
Copy link

@jwulf jwulf commented Jun 21, 2017

Same thing with the latest update:

Docker version 17.06.0-ce-rc4, build 29fcd5d

Diagnostic ID:

1FACDAD0-44D8-4042-BEB0-6E4A93861395

screen shot 2017-06-21 at 6 22 30 pm

Loading

@jedie
Copy link

@jedie jedie commented Jun 23, 2017

I can confirm this, and many other users, too, see: many "confirm" posts here: https://forums.docker.com/t/com-docker-hyperkit-up-cpu-to-340/13057

or:
moby/hyperkit#58
#1568

Any work-a-round?

Loading

@rmatec
Copy link

@rmatec rmatec commented Jul 3, 2017

Same here.
Docker:
Version 17.03.1-ce-mac5 (16048)

Diagnostic ID:
B9EA3FE6-68B0-4792-85BD-D92642119587

Loading

@ecoopnet
Copy link

@ecoopnet ecoopnet commented Jul 7, 2017

+1

Loading

@nmquyet
Copy link

@nmquyet nmquyet commented Jul 8, 2017

yes, i have the exact same issue. It consumes my battery pretty fast. This is so frustrated

screen shot 2017-07-08 at 2 39 20 pm

screen shot 2017-07-08 at 2 39 05 pm

Diagnostic ID:
3E5FC66A-383B-4FA5-B609-75AF769E1495

Loading

@Hemantkumar-Chigadani
Copy link

@Hemantkumar-Chigadani Hemantkumar-Chigadani commented Jul 18, 2017

Same here, +1.

Loading

@ahalyakumari95
Copy link

@ahalyakumari95 ahalyakumari95 commented Aug 2, 2017

I am facing the same too.

Loading

@alexcrownus
Copy link

@alexcrownus alexcrownus commented Aug 15, 2017

Same here

Loading

@spetrashov
Copy link

@spetrashov spetrashov commented Aug 18, 2017

Confirm the same problem
Docker version 17.07.0-ce-rc2, build 36ce605
Diagnostic ID:
1C9F0E05-F0C7-4E73-A9CB-3DBD5B5E34A8

Loading

@montera82
Copy link

@montera82 montera82 commented Aug 21, 2017

same here ... any update in this issue ?

Version 17.06.0-ce-mac19 (18663)
Channel: stable
c98c1c25e0

Loading

@nmquyet
Copy link

@nmquyet nmquyet commented Aug 21, 2017

issue persisted

Loading

@mrfoh
Copy link

@mrfoh mrfoh commented Aug 25, 2017

Same problem here
Docker version 17.06.0-ce, build 02c1d87

Loading

@davidharrigan
Copy link

@davidharrigan davidharrigan commented Aug 25, 2017

+1, Same here:

Docker version 17.06.1-ce, build 874a737

DiagnosticID: 35CB31D1-06CA-45D5-9DE5-7DACBCC100BF

Loading

@mrfoh
Copy link

@mrfoh mrfoh commented Aug 25, 2017

Got CPU usage down by limiting Docker to a single CPU from the docker settings

Loading

@filfreire
Copy link

@filfreire filfreire commented Aug 28, 2017

I'm experiencing the same issue,
Version 17.06.1-ce-mac24 (18950)
Channel: stable
54dc09c3e3

Loading

@petterik
Copy link

@petterik petterik commented Aug 28, 2017

I removed all data and the hyperkit cpu usage went from 150% to 0.9%. I have 2 cores dedicated to docker.

Version:

Version 17.06.1-ce-mac24 (18950)
Channel: stable
54dc09c3e3

Removed all data with the following steps:

* Click on Docker icon in my menu bar
* Preferences
* Reset
* Remove all data
* Delete

Loading

@snackycracky
Copy link

@snackycracky snackycracky commented Sep 5, 2017

@petterik that helped for a minute, after I rebuild my app the cpu is back to ~300% for hyperkit and 85% for com.docker.osxfs on OSX 10.12.6 (16G29) with Docker Version 17.06.1-ce-mac24 (18950) Channel: stable 54dc09c3e3

Loading

@johannessjoberg
Copy link

@johannessjoberg johannessjoberg commented Sep 15, 2017

+1

  • 100-170% CPU by hyperkit
  • OSX Version: 10.12.6, 2.9 GHz Intel Core i5
  • Docker: Version 17.07.0-ce-rc1-mac21 (18848), 2 cores dedicated

Loading

@zhaoqingchris
Copy link

@zhaoqingchris zhaoqingchris commented Sep 17, 2017

+1

OSX Version: 10.12.6 (16G29)
Docker version 17.06.2-ce, build cec0b72

Loading

@janetthecoder
Copy link

@janetthecoder janetthecoder commented Sep 22, 2017

+1

Loading

@slykar
Copy link

@slykar slykar commented Sep 22, 2017

+1

macOS Sierra 10.12.6 (16G29)
Docker: 17.06.2-ce-mac27 (19124)

Loading

@karlbunch
Copy link

@karlbunch karlbunch commented Sep 23, 2017

I was running a fairly large build (compiles a bunch of code etc).

Was working well for a while and then all of a sudden now I've got this hang at 100% cpu.

I tried bumping resources up etc.

System Version: macOS 10.12.6 (16G29)
Kernel Version: Darwin 16.7.0
Docker version 17.06.2-ce, build cec0b72

I spooled up a bare metal box on packet.net and my build works fine without any hangs.

+ uname -a
Linux build-dev01 4.10.0-24-generic #28-Ubuntu SMP Wed Jun 14 08:14:34 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
+ cat /etc/os-release
NAME="Ubuntu"
VERSION="16.04.2 LTS (Xenial Xerus)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 16.04.2 LTS"
VERSION_ID="16.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
VERSION_CODENAME=xenial
UBUNTU_CODENAME=xenial
+ docker --version
Docker version 17.06.2-ce, build cec0b72

Loading

@scanarjo
Copy link

@scanarjo scanarjo commented Sep 27, 2017

+1

macOS High Sierra 10.13 (17A365)
Docker Stable: 17.06-ce-mac27 (19124)

Loading

@pdlipman
Copy link

@pdlipman pdlipman commented Sep 27, 2017

+1

MacOS Sierra: 10.12.6 (16G29)
Version 17.06.2-ce-mac27 (19124)
Channel: stable

Loading

@johannessjoberg
Copy link

@johannessjoberg johannessjoberg commented Sep 28, 2017

One thing that helped me out was disable/setting interval on any polling.

This problem arose for me when polling was enabled in webpack. Disabling it lead to hyperkit being ~1% CPU in idle state. But also setting a interval on the polling at 4000ms lead to 20-40% CPU usage instead of ~150%.

Loading

@scanarjo
Copy link

@scanarjo scanarjo commented Sep 29, 2017

Just an update with some of my findings:
I am still seeing CPU usage of 300% for hyperkit with Docker prefs set to 1 CPU and the Docker daemon isn't even running anymore...

Loading

@scanarjo
Copy link

@scanarjo scanarjo commented Sep 29, 2017

Further update: Edge does not seem to have the same issue. Uninstalled Stable and installed Edge and hyperkit CPU usage is now normal again

Loading

@armartinez
Copy link

@armartinez armartinez commented Aug 25, 2020

Thanks for that, @marco-m, and hi everyone. We'd love you to try out our latest Edge release, 2.3.5.0. This has all our best fixes for CPU improvements. You can get it at https://desktop.docker.com/mac/edge/47376/Docker.dmg.

The largest change is that (by default) it uses gRPC-FUSE instead of osxfs. This brings a big improvement in file sharing speed as well as CPU usage. We think that the majority of the CPU problems in previous versions are osxfs related.

For CPU load when using Kubernetes, we have made some improvements by supplying some different arguments to Kubernetes. There are still some problems that can only be fixed upstream, but it is improved in this release.

There are a few other unrelated fixes too (and actually, one last one we're still working on).

Assuming no major bugs, these fixes will make it into the next Stable release. So for anyone who can try the Edge release, we would love you to do so and give us some feedback. Are you seeing CPU improvements? Any remaining issues?

Thank you.

For me it worked fine with gRPC-FUSE enabled, which I also needed to enable in the settings. With osxfs I had high CPU usage again.

Loading

@woodfairy
Copy link

@woodfairy woodfairy commented Aug 26, 2020

This version seems to be slower than 2.3.4.0. average load time for my symfony app went from 1-2 seconds to 6-7 seconds with gRPC-FUSE enabled.

EDIT: Downgraded to 2.3.4.0 again, working much better. By the way, CPU usage is still not good, but at least my applications run kind of fast and are usable.

Loading

@romainmenke
Copy link

@romainmenke romainmenke commented Sep 1, 2020

CPU usage is high here, but performance seems better.

Loading

@JamesonNetworks
Copy link

@JamesonNetworks JamesonNetworks commented Sep 1, 2020

Seems to be another update out on Edge, version 2.3.6.0 which referenced another CPU usage bug involving the serial console in hyperkit:

  • Fixed a Mac CPU usage bug by removing the serial console from hyperkit, see docker/roadmap#12. To open a shell in the VM use either nc -U ~/Library/Containers/com.docker.docker/Data/debug-shell.sock (on Mac) or putty -serial \\.\pipe\dockerDebugShell (on Windows).

Loading

@woodfairy
Copy link

@woodfairy woodfairy commented Sep 7, 2020

2.3.6.0 has about same performance than the 2.3.5.0
As soon as I install 2.3.4.0, the performance is a lot better again.
But. the CPU issues seem to be gone in 2.3.6.0, at least when the container is "idle" and does nothing very expensive. I'll stick with 2.3.4.0 as it has the best real and measured performance for my project.

"Benchmarking" for Symfony 3.4 project (quite heavy one, not very optimised for performance)
On 2.3.4.0:
average loading time for a page is 1-3 seconds
CPU usage stil too high when "idle" (80% in avg)
On 2.3.5.0:
average loading time for a page is 4-6 seconds
CPU usage still too high when "idle" (80% in avg)
On 2.3.6.0:
average loading time for a page is 5-7 seconds
CPU usage is fixed when container is "idle" (8% in avg)

Loading

@anton-kozlovsky
Copy link

@anton-kozlovsky anton-kozlovsky commented Sep 9, 2020

Upgraded to 2.3.6, it causes huge CPU load. Downgraded back to 2.3.4.

Loading

@dyriavin
Copy link

@dyriavin dyriavin commented Sep 23, 2020

I have determined why CPU usage is raising more than 300% (in my case).
I am using the Docker for PHP development ( Laravel Framework ) with the Reddis ( 3.** version ).
In case if docker is running up all of the containers which are connecting to Reddis ( like artisan queues ) it raises that CPU threshold.
Also the Horizon for Lararvel using around 50%.
When i am switching to the latest version of Reddis, it helps a bit but still not perfect at all.
I can't find the solution with a CPU usage for my mac machine.
Still thinks, that its up on mac issue, because of I am running the same docker project on Linux - and it works fine.
Is there is any suggestions, which can help with this issue?

Tested with a 2.3.4 edge version of docker.
CPU usage decreased to 70-80%

Loading

@armartinez
Copy link

@armartinez armartinez commented Sep 25, 2020

I installed 2.3.7.0 and CPU performance was back at 200%-400%, so I downgraded to 2.3.5.0.

Loading

@SemyenSoldatenko
Copy link

@SemyenSoldatenko SemyenSoldatenko commented Oct 5, 2020

Version 19.03.13 - consumes 10.3% CPU when no containers are running. 🙅

Loading

@nebuk89
Copy link

@nebuk89 nebuk89 commented Oct 8, 2020

Hey all,

We have now shipped the changes from our investigation over the last 3 months as part of the 2.4 Desktop release.
This does not mean we have got all of the bugs potentially causing this (we fixed a new one yesterday! ) but it is the point where we are no longer going to be driving a significant investigation into multiple potential root causes to this. (which was tracked under docker/roadmap#12)

We will do a blog post in a few weeks detailing the things we found/changes we made to give you some insight into what we did and why.

If you are still having issues, I would ask that you create new tickets on for-mac rather than comment on old tickets as we are going to close these to keep our backlog a bit tidier and not mix up the messages (and it is easier for us to get signal on the scale of issues this way).

Thanks again for your patience and an even bigger thank you to all of you who took the time to test builds & upload diagnostics!

Loading

@nebuk89 nebuk89 closed this Oct 8, 2020
@aheissenberger
Copy link

@aheissenberger aheissenberger commented Oct 20, 2020

I still have the problem with high CPU consumption with version 2.4.0.0 but I could fix it by switching von 2 CPU to 1 CPU in the Preferences -> Resources Panel.

Loading

@neil-re
Copy link

@neil-re neil-re commented Oct 29, 2020

Current Docker Desktop requires to specify (preferences --> resources tab) the amount of CPU and Memory to use. It will use (reserve) it regardless it's in use or not. It's currently a bug, should be dynamically allocated until the max specified.
By now, if you are not running a container, just shut it down (quit docker desktop)

Loading

@darkn3rd
Copy link

@darkn3rd darkn3rd commented Oct 29, 2020

There's just not a lot of insight into HyperKit, so it is hard or difficult for the community to troubleshoot and derive the root cause of the problem. This is why I like the Docker Machine option, despite Docker Desktop having a richer UX, as you could choose to use Virtualbox (which has richer CLI + GUI tools), HyperKit, or others. HyperKit is still ocassionally goes bonkers can consumes high CPU% and energy.

It is still not stable, if there are any notes from authors to get better insight, that would be great, such as profiles, and such. This way maybe the community can help with finding out the root cause.

Loading

@accelerated
Copy link

@accelerated accelerated commented Oct 30, 2020

Using latest 2.4.2.0 and still see consistently ~400% CPU loads. Tried a few of the recommendations but nothing works.

Loading

@jonesiscoding
Copy link

@jonesiscoding jonesiscoding commented Nov 2, 2020

One of our developers is experiencing this issue while using 2.4.0. CPU load has been consistently between 200% and 400%, with the majority of the day sitting around 400%

Diagnostics ID: 67181D6B-0B77-4EA1-87E7-1013ABB9F94E/20201102184010

Loading

@matei-dragu
Copy link

@matei-dragu matei-dragu commented Nov 2, 2020

@accelerated @jonesiscoding version 2.5.0.0 just came out - might be worth giving it a try

Loading

@jonesiscoding
Copy link

@jonesiscoding jonesiscoding commented Nov 3, 2020

@matei-dragu Updating to version 2.5.0.0 helped for a few hours. Most of the morning the user was seeing ~25% CPU from the com.docker.hyperkit process. That spiked to ~400% about 15 minutes ago, and hasn't gone down since.

Loading

@dyriavin
Copy link

@dyriavin dyriavin commented Nov 4, 2020

Have tried 2.5.0
CPU usage is 30-40% w/o running Containers/Images

Loading

@stevo-knievo
Copy link

@stevo-knievo stevo-knievo commented Nov 4, 2020

How do I get 2.5.0.0 version? I'm on the edge channel (2.4.2.0) and they are no updates. I guess I need to switch back to the stable channel... or is there another trick? Thanks

Loading

@stephen-turner
Copy link
Contributor

@stephen-turner stephen-turner commented Nov 5, 2020

Yes, switch to stable if you want it immediately. Latest edge is currently 2.4.2.0 as you observed.

Loading

@stevo-knievo
Copy link

@stevo-knievo stevo-knievo commented Nov 5, 2020

Thanks @stephen-turner
You would think if you are on the edge channel you would always get the latest.

Loading

@jakeonfire
Copy link

@jakeonfire jakeonfire commented Nov 6, 2020

@matei-dragu Updating to version 2.5.0.0 helped for a few hours. Most of the morning the user was seeing ~25% CPU from the com.docker.hyperkit process. That spiked to ~400% about 15 minutes ago, and hasn't gone down since.

strangely, mine goes down sometimes when i run diagnostics. which may mean some of these issues are Schrodinger's issues.

Loading

@asko
Copy link

@asko asko commented Nov 6, 2020

same here, flat ~25% w/o running containers, 2.5.0.0

Loading

@nearbody
Copy link

@nearbody nearbody commented Nov 30, 2020

Still, having the same issue with version 2.5.2, what to do ?? Is it ever going to be solved?

Loading

@stephen-turner
Copy link
Contributor

@stephen-turner stephen-turner commented Nov 30, 2020

There is a new regression in 2.5 because of the new Linux kernel we have in that version. We're working on it. See #5044 for more details.

Loading

@docker-desktop-robot
Copy link
Collaborator

@docker-desktop-robot docker-desktop-robot commented Dec 30, 2020

Closed issues are locked after 30 days of inactivity.
This helps our team focus on active issues.

If you have found a problem that seems similar to this, please open a new issue.

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

Loading

@docker docker locked and limited conversation to collaborators Dec 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.