Skip to content

High CPU usage on host #3539

Closed
Closed

Description

@marek-obuchowicz
  • I have tried with the latest version of my channel (Stable or Edge)
  • I have uploaded Diagnostics
  • I have tried to reset docker to factory defaults
  • Diagnostics ID: D8C4C1BC-B3EE-42E6-9875-74843E9A55E7/20190221083009

Expected behavior

Host OS should not be using so much CPU when docker is running.

Actual behavior

I have 6 containers running (posgtgresql, redis, elasticsearch and PHP applicatons). They are basically doing nothing - no data is flowing thru the system and web-application is not getting any requests. The CPU usage on the docker VM, as indicated by top command, is very small (1-3%), but on host OS the process com.docker.hyperkit is consuming up to 70% CPU, causing my machine to produce excess heat and slowing down "everything".

Information

The problem used to be happen since a few months, i can't surely say that it is related to any specific update.

  • macOS Version: 10.12.6
  • docker-for-mac version: 2.0.0.3 (31259), stable
  • hardware: 8vCPU (4-core intel i7), 16GB RAM, SSD drive
  • resources allocated to docker: 4vCPU, 3GB RAM, 2GB SWAP

The issue seems to be regarding docker-for-mac VM. If I use VirtualBox to start Linux, allocate same resources and start containers - load on host OS is barely visible, as expected.

No osxfs is used, no files are shared with the host OS.

Activity

  1. Housik commented on Feb 21, 2019

    @Housik

    Same happening to me, almost zero cpu usage inside containers, but com.docker.hyperkit is constantly consuming between 30% to 50% CPU.

    • Docker Engine version 18.09.2
    • OS X version 10.14.3
    • Diagnostics ID: F3876880-AD64-4811-BC9E-1FF410B98410/20190221112519
  2. kammoh commented on Feb 28, 2019

    @kammoh

    Same issue, but no container running at all! Happen even after clean reinstall (deleted all everything under ~/Library/Containers). com.docker.hyperkit is running with 18 threads and 240% CPU usage even after docker.app is closed.

    • Docker version 18.09.2, build 6247962
    • OS X version 10.14.3
  3. hemith commented on Mar 7, 2019

    @hemith

    Same actual bahavior.

    Information

    • old macbook pro(i7) -Docker Community Edition (v 17.12.0-ce-mac55 d62ef8d1b0)
      It's OK.

    I bought new macbook pro recently.

    • new macbook pro(i9) - Docker Desktop Community (v 2.0.0.3 (31259) 8858db33c8)
      It's not OK.

    I installed Latest Docker Desktop Community on my new macbook pro.
    Initially, there was a very high CPU load. However, after restarting the docker and using it, the CPU load is not so high.

    • macOS Version: 10.14.3
    • docker-for-mac version: 2.0.0.3 (31259), stable
    • hardware: Intel Core i9 / 2.9 GHz / 6 cores , 32GB RAM, SSD drive
    • resources allocated to docker: 4vCPU, 3GB RAM, 2GB SWAP
  4. treedy commented on Apr 11, 2019

    @treedy

    From a fresh install of Docker Desktop Community, I regularly observe about 4% CPU utilization of com.docker.hyperkit. When I enable K8s I notice a sustained 40-60% CPU utilization. Both figures are without any other non-system or non-k8s containers running.

    macOS Version: 10.14.3
    Docker Desktop Community version: 2.0.0.3 (31259), stable
    hardware: Intel Core i7 / 2 GHz / 8 cores , 16GB RAM, SSD drive
    resources allocated to docker: 4vCPU, 2GB RAM, 1GB SWAP
    Kubernetes: v1.10.11

  5. marek-obuchowicz commented on Apr 15, 2019

    @marek-obuchowicz
    Author

    Due to high CPU usage, we have evaluated other hypervisors. Quick benchmarks showed that hypervisor used by docker is slower (in terms of IO and CPU) than other alternatives, like virtualbox, parallels or vmware. We have switched to docker-machine and minikube with NFS, which resulted in lower CPU usage and much nicer IO (for both local images and shared filesystems). While this solution has more complicated setup than docker-for-mac, it also enables a big performance boost for daily docker usage (especially if combined with parallels/vmware fusion, but even virtualbox seems to be better choice than hyperkit).

  6. bgehman commented on May 30, 2019

    @bgehman

    Ya'll sure this is a docker problem and not a Kubernetes problem?

    Docker Whale --> Preferences --> Kubernetes --> Check "Show System Containers"
    

    Then run docker stats and see what you can see...

  7. eplanet commented on Jun 4, 2019

    @eplanet

    Actually disabling Kubernetes single-node cluster stopped the ridiculous 100% usage for me. Thanks for the tip!

  8. ajsharp commented on Jun 22, 2019

    @ajsharp

    Anyone from Docker had a look at this? This is clearly an ongoing major problem.

    cc @mikeparker @akimd

  9. dfang commented on Aug 1, 2019

    @dfang

    com.docker.hyperkit always consumes a lot of cpu ...

  10. dragonfax commented on Aug 20, 2019

    @dragonfax

    Is this problem still being ignored? fluctuating 45-70% cpu usage, when i've got no containers and pods at all (only system containers). Tried this on 2 different macs. And clean installations of Docker for Mac.

  11. teolisitza commented on Aug 23, 2019

    @teolisitza

    Is this problem still being ignored? fluctuating 45-70% cpu usage, when i've got no containers and pods at all (only system containers). Tried this on 2 different macs. And clean installations of Docker for Mac.

    Same same:

    macOS Version: 10.14.4
    Docker Desktop Community version: 2.1.0.1, stable
    hardware: Intel Core i7 / 2 GHz / 8 cores , 16GB RAM, SSD drive
    resources allocated to docker: 8vCPU, 6GB RAM, 1GB SWAP

  12. ashishsc commented on Aug 26, 2019

    @ashishsc

    Same experience here:
    No containers running
    OSX 10.14.4
    Docker Desktop Community version 2.1.0.1
    Hardware: MBP 2019, i7, 6 cores @ 2.6GHz, 32GB RAM

    Cpu usage: 11%

  13. vdavari commented on Aug 30, 2019

    @vdavari

    +1

  14. FlorinAndrei commented on Sep 12, 2019

    @FlorinAndrei

    +1

    Docker Desktop 2.1.0.2
    macOS 10.14.6

    com.docker.hyperkit is at 30 ... 50% CPU even with no containers and no images
    Kubernetes is running (but, again, no containers have been created)

    EDIT: Stopping Kubernetes made the issue disappear - CPU usage is back to normal.

    But K should not eat CPU like this even when it's doing nothing. That's not normal.

  15. 17 remaining items

  16. 170 commented on Feb 5, 2020

    @170

    @douglascorrea
    Did you do Reset to factory defaults?
    It's fixed on my MacBook tentatively.

  17. douglascorrea commented on Feb 8, 2020

    @douglascorrea

    @170 I've tried but didn't worked, moved to use default apache and install postresql via brew in my machine

  18. cabezayunke commented on Mar 20, 2020

    @cabezayunke

    Same problem here.
    CPU for docker hyperkit between 40% and 70% with kubernetes enabled. Down to 9% when disabled.

    Docker engine 19.03.8
    Mac OS 10.15.3
    Docker desktop 2.2.0.4
    kubernetes 1.15.5

  19. m3talsmith commented on Jun 10, 2020

    @m3talsmith

    Just switched back to a Mac from Windows and Linux. Was wondering why my fan was screaming for over an hour. Checked the activity monitor to see docker Desktop had my CPU pegged around 140%. Quit Docker and all is nice and quiet now. My rust compilations don't even spin the fan up that much! Considering this was all a fresh install and I hadn't even used Docker yet, and looking at this thread, I'd say the mac version has some serious problems. I'm going to go grab podman and buildah while you sort this out Docker.

  20. ozburo commented on Jun 10, 2020

    @ozburo

    @m3talsmith pls report back your findings if you find a decent alternative for running Docker based containers on a Mac! It's been this way since forever 😄

  21. djs55 commented on Jul 30, 2020

    @djs55
    Contributor

    Hi -- a quick progress update on the Mac CPU issue: It seems to be a mixture of several bugs including

    1. excessively large queues of events in the filesharing implementation -- there is a proposed fix for this but it's not in any current release build
    2. a clash with osquery over the hyperkit serial console: this is fixed in Edge but not in Stable
    3. a further problem with the hyperkit serial console: there is a proposed fix for this but it's not in any current release build

    (and possibly more, since the symptoms are all very similar it means they're hard to tell apart)

    There is a development build with all the current known fixes (for 1, 2 and 3): https://desktop-stage.docker.com/mac/edge/47050/Docker.dmg (Edited to make this a notarized build) . If you have a chance to try it, please do and let me know how it goes. Unfortunately the build is signed but not notarized so you will need to open it in finder, right click and click on "Open" to bypass the notarization check. I'm very interested to hear both about any bugs in this build and about any remaining CPU issues. Thanks!

  22. Sutharsan commented on Aug 3, 2020

    @Sutharsan

    @djs55, Docker Desktop CPU usage dropped from 100+% to less than 5% when containers are (mostly) idle. Nice work.

  23. anton-kazlouski commented on Aug 5, 2020

    @anton-kazlouski

    @djs55 works for me! CPU usage dropped from 120+% to 10-20%.
    Got another minor problem with one volume, but if was easy to fix.

  24. ikwattro commented on Aug 8, 2020

    @ikwattro

    @djs55 Works for me, dropped from 100+% to 8%. Great work and thank you !

  25. stephen-turner commented on Aug 21, 2020

    @stephen-turner
    Contributor

    I'm going to dupe this against the main CPU ticket, #3499, so that we can consolidate the conversation in one place. I've just posted a new build there that you can try.

  26. docker-robott commented on Sep 20, 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

  27. locked and limited conversation to collaborators on Sep 20, 2020
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