Skip to content

Hyperkit process on MacOS continuously using approx 50% CPU #2601

Closed

Description

@evoncken

Expected behavior

With no user workload / containers running, expect CPU usage to be very low.

Actual behavior

"hyperkit" process using aprox. 50% CPU all the time

Information

Diagnostics ID: 1582F6B0-78F2-4F39-9BDC-67E37D52D34B

Steps to reproduce the behavior

  1. Install Docker for Mac (Edge, with Kubernetes enabled)
  2. Check hyperkit CPU usage in Activity Monitor

Activity

  1. w4-jungyeol commented on Mar 27, 2018

    @w4-jungyeol

    I've also seen the memory usage at the top. About 1.85 GB. Not sure if it is normal.

  2. richardthombs commented on Apr 4, 2018

    @richardthombs

    Still happening on Docker version 18.03.0-ce, build 0520e24

  3. vinayan3 commented on Apr 26, 2018

    @vinayan3

    Any updates on this? It's a little bit of a blocker for me to keep this on all the time. It drains my laptop battery when unplugged.

  4. anacrolix commented on Apr 30, 2018

    @anacrolix

    I think it went away when i shut down a container I forgot about.

  5. atombender commented on May 28, 2018

    @atombender

    This urgently needs to be fixed. It's important to note that while there are many issues about Docker for Mac consuming an insane amount of CPU, those reports seem to be related to actual workloads. But this issues when there are no containers running (other than Kubernetes itself). A simple reset and restart will trigger the problem.

  6. atombender commented on May 28, 2018

    @atombender

    Looking at the actual VM, this seems like a typical distribution of CPU usage among the Kubernetes processes:

    18774 18757 root     S     153m   4%   0   7% kube-controller-manager --kubeconf
     1130  1015 root     S     787m  20%   0   6% /usr/local/bin/dockerd -H unix:///
     1016   906 root     S     247m   6%   0   4% kubelet --kubeconfig=/etc/kubernet
    11142 11124 root     S     721m  18%   0   3% kube-apiserver --advertise-address
    14329 14312 root     S    53468   1%   0   1% kube-scheduler --address=127.0.0.1
    

    First, looking at the logs, something is continuously calling Docker's API with requests such as /v1.31/containers/json. I'm going to assume this is the Kubelet. But the Kubelet doesn't log any activity corresponding to the frequency of requests, and neither does kube-controller-manager. apiserver does log a little bit:

    2018-05-28T19:03:15.431464400Z I0528 19:03:15.431266       1 controller.go:105] OpenAPI AggregationController: Processing item v1beta1.compose.docker.com
    2018-05-28T19:03:16.387777600Z E0528 19:03:16.387645       1 controller.go:111] loading OpenAPI spec for "v1beta1.compose.docker.com" failed with: OpenAPI spec does not exists
    2018-05-28T19:03:16.388078600Z I0528 19:03:16.387994       1 controller.go:119] OpenAPI AggregationController: action for item v1beta1.compose.docker.com: Rate Limited Requeue.
    2018-05-28T19:03:17.368711500Z I0528 19:03:17.368437       1 controller.go:105] OpenAPI AggregationController: Processing item v1beta2.compose.docker.com
    2018-05-28T19:03:17.371758900Z E0528 19:03:17.371636       1 controller.go:111] loading OpenAPI spec for "v1beta2.compose.docker.com" failed with: OpenAPI spec does not exists
    2018-05-28T19:03:17.372081200Z I0528 19:03:17.372001       1 controller.go:119] OpenAPI AggregationController: action for item v1beta2.compose.docker.com: Rate Limited Requeue.
    2018-05-28T19:04:16.316600800Z I0528 19:04:16.316422       1 controller.go:105] OpenAPI AggregationController: Processing item v1beta1.compose.docker.com
    2018-05-28T19:04:16.321664900Z E0528 19:04:16.321553       1 controller.go:111] loading OpenAPI spec for "v1beta1.compose.docker.com" failed with: OpenAPI spec does not exists
    2018-05-28T19:04:16.321878200Z I0528 19:04:16.321822       1 controller.go:119] OpenAPI AggregationController: action for item v1beta1.compose.docker.com: Rate Limited Requeue.
    2018-05-28T19:04:17.304634900Z I0528 19:04:17.301377       1 controller.go:105] OpenAPI AggregationController: Processing item v1beta2.compose.docker.com
    2018-05-28T19:04:17.311260900Z E0528 19:04:17.306398       1 controller.go:111] loading OpenAPI spec for "v1beta2.compose.docker.com" failed with: OpenAPI spec does not exists
    2018-05-28T19:04:17.311302000Z I0528 19:04:17.306541       1 controller.go:119] OpenAPI AggregationController: action for item v1beta2.compose.docker.com: Rate Limited Requeue.
    

    It doesn't seem enough to indicate high CPU usage, but the note about rate-limiting is interesting. strace on the API server also shows a continuous stream of activity, though it appears to be binary (gRPC and/or TLS-encrypted), and so I don't know what it is. I do see that the API server has 91 TCP connections open, which seems excessive.

  7. tristanpemble commented on May 29, 2018

    @tristanpemble

    we are aware of this issue and track it internally. The amount of CPU taken varies from system to system and is only present when Kube is enabled. With Kube enabled a couple of fairly chunky containers are running and it is yet unclear if it is these containers taking up the CPU or interactions with HyperKit

    from this thread

    would like some public tracking of this issue

  8. jsternberg commented on Jul 12, 2018

    @jsternberg

    I can confirm that this is happening for me too and most of the developers have complained about kubernetes using docker for desktop on their macs causes their computers to get very loud. It happens most frequently when deploying and then begins to quiet down, but it's been over 10 minutes since I used the kubernetes api server, all of the deployed stuff is running without any restarts, and I'm still getting a large amount of cpu used. I get these log lines once a minute from the api server:

    I0712 14:28:57.714579       1 controller.go:105] OpenAPI AggregationController: Processing item v1beta1.compose.docker.com
    E0712 14:28:57.721750       1 controller.go:111] loading OpenAPI spec for "v1beta1.compose.docker.com" failed with: OpenAPI spec does not exists
    I0712 14:28:57.721794       1 controller.go:119] OpenAPI AggregationController: action for item v1beta1.compose.docker.com: Rate Limited Requeue.
    I0712 14:28:58.679366       1 controller.go:105] OpenAPI AggregationController: Processing item v1beta2.compose.docker.com
    E0712 14:28:58.683655       1 controller.go:111] loading OpenAPI spec for "v1beta2.compose.docker.com" failed with: OpenAPI spec does not exists
    I0712 14:28:58.683702       1 controller.go:119] OpenAPI AggregationController: action for item v1beta2.compose.docker.com: Rate Limited Requeue.
    
  9. IngaFeick commented on Jul 24, 2018

    @IngaFeick

    Same happens to me and pretty much everyone I know who's using Docker for Mac. Strangely it seems to happen mostly when no container is running.

  10. ypresto commented on Jul 26, 2018

    @ypresto

    htop in privileged container when Kubernetes is enabled:
    image

    disabled:
    image

  11. mitchellnemitz commented on Aug 27, 2018

    @mitchellnemitz

    Any movement on this issue? A fresh install of Docker for Mac on a fresh install of OSX this morning sees CPU usage hovering at 35-50% and Activity Monitor's "Energy Impact" rating for Docker sitting around ~70, which is absurdly high.

    Is there anything we users can do to help push this one forward? More data collection maybe, collecting logs or providing profiling output? If there's already a fix that needs tested, is there a way for us to chip in and verify it's working with our setups?

  12. 47 remaining items

  13. rfay commented on Apr 2, 2020

    @rfay

    /remove-lifecycle stale

  14. rfay commented on Apr 2, 2020

    @rfay

    /lifecycle frozen

  15. jsanhc commented on Jun 17, 2020

    @jsanhc

    /remove-lifecycle stale

  16. jsanhc commented on Jun 17, 2020

    @jsanhc

    /lifecycle frozen

  17. HarryWeppner commented on Jun 17, 2020

    @HarryWeppner

    @jorgesanchezperez this is a very real issue!

  18. dvic commented on Jun 21, 2020

    @dvic

    @jorgesanchezperez I can confirm that this issue is still present, around 50% cpu with no containers, logs of the api server still show the following
    image

    edit: I can also confirm that disabling Kubernetes "fixes" the issue

  19. ebriney commented on Jun 26, 2020

    @ebriney
    Member

    Hi everybody, we are currently actively investigating on that problem but we lack some information and we need your help.
    We added spindump in diagnostics in that (not yet released) build: https://desktop-stage.docker.com/mac/edge/46292/Docker.dmg
    If you have the chance to got cpu locks in any of our process, can you do a diagnose and put it in: docker/roadmap#12
    Thanks.

  20. stephen-turner commented on Jul 7, 2020

    @stephen-turner
    Contributor

    I'm going to close this ticket. As @ebriney says, we are in the middle of a big investigation about Mac CPU usage. However, this specific ticket is an upstream issue in Kubernetes, kubernetes/kubernetes#75565, which we cannot fix in Docker Desktop. Other single-node Kubernetes distributions (minikube, kind, etc.) suffer from the same problem (see #3065 for a long conversation on this). So it needs to be fixed upstream. Sorry that we can't do anything about it here.

    Of course, this doesn't affect the other CPU tickets we have open that are within Docker's domain. We are aware of them, accept responsibility for them, and are actively looking at them.

  21. locked and limited conversation to collaborators on Jul 7, 2020
  22. docker-robott commented on Aug 6, 2020

    @docker-robott
    Collaborator

    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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions