Skip to content

High CPU usage when just started, no containers running. #4392

Closed

Description

@armori
  • [ x ] I have tried with the latest version of my channel (Stable or Edge)
  • [ x ] I have uploaded Diagnostics
  • Diagnostics ID: BCBAA646-C246-4F57-AB7D-2B54F05CC21D/20200325071455

Expected behavior

Low CPU usage

Actual behavior

CPU usage stuck arount 120-130% (i5 5257U)

Information

  • macOS Version: 10.15.3

Diagnostic logs

Docker for Mac: version 2.2.0.4
time="2020-03-25T08:14:55+01:00" level=warning msg="[/usr/local/bin/kubectl.docker --namespace docker get pods -o go-template={{range .items}}{{.metadata.name}}\n{{end}}]: exit status 1" type=kubernetes
time="2020-03-25T08:14:55+01:00" level=warning msg="The connection to the server localhost:8080 was refused - did you specify the right host or port?\n" type=kubernetes
time="2020-03-25T08:14:55+01:00" level=warning msg="[/usr/local/bin/kubectl.docker --namespace kube-system get pods -o go-template={{range .items}}{{.metadata.name}}\n{{end}}]: exit status 1" type=kubernetes
time="2020-03-25T08:14:55+01:00" level=warning msg="The connection to the server localhost:8080 was refused - did you specify the right host or port?\n" type=kubernetes
time="2020-03-25T08:14:55+01:00" level=info msg="Start gathering list of 80 elements (timeout=10m0s)" type=list
time="2020-03-25T08:14:55+01:00" level=info msg="Executing: [sw_vers -productVersion]" type=cmd
time="2020-03-25T08:14:55+01:00" level=info msg="Executing: [sw_vers -buildVersion]" type=cmd
time="2020-03-25T08:14:55+01:00" level=info msg="Executing: [uname -r]" type=cmd
time="2020-03-25T08:14:55+01:00" level=info msg="Executing: [sysctl kern.boottime]" type=cmd
time="2020-03-25T08:14:55+01:00" level=info msg="Executing: [sysctl hw.memsize]" type=cmd
time="2020-03-25T08:14:55+01:00" level=info msg="Executing: [vm_stat]" type=cmd
time="2020-03-25T08:14:55+01:00" level=info msg="Executing: [sysctl machdep.cpu]" type=cmd
time="2020-03-25T08:14:55+01:00" level=info msg="Executing: [uname -a]" type=cmd
time="2020-03-25T08:14:55+01:00" level=info msg="Executing: [ps uax]" type=cmd
time="2020-03-25T08:14:56+01:00" level=info msg="Executing: [dmesg]" type=cmd
time="2020-03-25T08:14:56+01:00" level=warning msg="[dmesg] exit status 1" type=cmd
time="2020-03-25T08:14:56+01:00" level=warning msg="[dmesg]: Unable to obtain kernel buffer: Operation not permitted\nusage: sudo dmesg\n" type=cmd
time="2020-03-25T08:14:56+01:00" level=info msg="Executing: [id]" type=cmd
time="2020-03-25T08:14:56+01:00" level=info msg="Executing: [sysctl -a]" type=cmd
time="2020-03-25T08:14:56+01:00" level=info msg="Executing: [mount]" type=cmd
time="2020-03-25T08:14:56+01:00" level=info msg="Executing: [df -h]" type=cmd
time="2020-03-25T08:14:56+01:00" level=info msg="Executing: [launchctl print-disabled system]" type=cmd
time="2020-03-25T08:14:56+01:00" level=info msg="Executing: [system_profiler SPHardwareDataType]" type=cmd
time="2020-03-25T08:14:56+01:00" level=info msg="Executing: [defaults read /Library/Preferences/com.apple.alf.plist]" type=cmd
time="2020-03-25T08:14:56+01:00" level=info msg="Executing: [ifconfig -a]" type=cmd
time="2020-03-25T08:14:56+01:00" level=info msg="Executing: [netstat -ln]" type=cmd
time="2020-03-25T08:14:56+01:00" level=info msg="Executing: [netstat -mm]" type=cmd
time="2020-03-25T08:14:56+01:00" level=info msg="Executing: [netstat -nr]" type=cmd
time="2020-03-25T08:14:56+01:00" level=info msg="Gathering: /etc/resolv.conf" type=file
time="2020-03-25T08:14:56+01:00" level=info msg="Gathering: /etc/hosts" type=file
time="2020-03-25T08:14:56+01:00" level=info msg="Executing: [scutil --dns]" type=cmd
time="2020-03-25T08:14:56+01:00" level=info msg="Executing: [scutil --nc list]" type=cmd
time="2020-03-25T08:14:56+01:00" level=info msg="Executing: [scutil --proxy list]" type=cmd
time="2020-03-25T08:14:56+01:00" level=info msg="Executing: [system_profiler SPFirewallDataType]" type=cmd
time="2020-03-25T08:14:56+01:00" level=info msg="HTTP GET: localhost /v1.24/version" type=http
time="2020-03-25T08:14:56+01:00" level=info msg="HTTP GET: localhost /v1.24/info" type=http
time="2020-03-25T08:14:56+01:00" level=info msg="HTTP GET: localhost /v1.24/containers/json?all=1" type=http
time="2020-03-25T08:14:56+01:00" level=info msg="HTTP GET: localhost /v1.24/nodes" type=http
time="2020-03-25T08:14:56+01:00" level=info msg="HTTP GET: localhost /v1.24/services" type=http
time="2020-03-25T08:14:56+01:00" level=info msg="HTTP GET: localhost /v1.24/networks" type=http
time="2020-03-25T08:14:56+01:00" level=info msg="Executing: [/bin/sh -c docker network inspect $(docker network ls -q)]" type=cmd
time="2020-03-25T08:14:57+01:00" level=warning msg="kubernetes context cannot be reached. Ignoring gatherer:describepods" type=kubectl
time="2020-03-25T08:14:57+01:00" level=warning msg="kubernetes context cannot be reached. Ignoring gatherer:describedaemonset" type=kubectl
time="2020-03-25T08:14:57+01:00" level=warning msg="kubernetes context cannot be reached. Ignoring gatherer:describereplicaset" type=kubectl
time="2020-03-25T08:14:57+01:00" level=warning msg="kubernetes context cannot be reached. Ignoring gatherer:describedeployments" type=kubectl
time="2020-03-25T08:14:57+01:00" level=warning msg="kubernetes context cannot be reached. Ignoring gatherer:describepods" type=kubectl
time="2020-03-25T08:14:57+01:00" level=warning msg="kubernetes context cannot be reached. Ignoring gatherer:describedaemonset" type=kubectl
time="2020-03-25T08:14:57+01:00" level=warning msg="kubernetes context cannot be reached. Ignoring gatherer:describereplicaset" type=kubectl
time="2020-03-25T08:14:57+01:00" level=warning msg="kubernetes context cannot be reached. Ignoring gatherer:describedeployments" type=kubectl
time="2020-03-25T08:14:57+01:00" level=info msg="Executing: [/bin/sh -c /usr/bin/log show --debug --info --style syslog --last 1d --predicate 'process matches \".*[Dd]ocker.*\" || (process in {\"kernel\", \"launchservicesd\", \"taskgated-helper\"} && eventMessage contains[c] \"docker\")']" type=cmd
time="2020-03-25T08:15:23+01:00" level=info msg="Executing: [syslog -F $((Time)(JZ)) $Host $(Sender)[$(Facility)][$(PID)] <$((Level)(str))>: $Message -o -k Sender Seq docker -o -k Sender Seq Docker -o -k Message Seq docker -o -k Message Seq Docker]" type=cmd
time="2020-03-25T08:15:23+01:00" level=warning msg="[syslog -F $((Time)(JZ)) $Host $(Sender)[$(Facility)][$(PID)] <$((Level)(str))>: $Message -o -k Sender Seq docker -o -k Sender Seq Docker -o -k Message Seq docker -o -k Message Seq Docker]: NOTE:  Most system logs have moved to a new logging system.  See log(1) for more information.\n" type=cmd
time="2020-03-25T08:15:23+01:00" level=info msg="Executing: [/bin/sh -c lsof -n -P -p $(pgrep -o com.docker.driver.amd64-linux)]" type=cmd
time="2020-03-25T08:15:23+01:00" level=info msg="Executing: [/bin/sh -c lsof -n -P -p $(pgrep -o com.docker.hyperkit)]" type=cmd
time="2020-03-25T08:15:24+01:00" level=info msg="Executing: [/bin/sh -c lsof -n -P -p $(pgrep -o com.docker.osxfs)]" type=cmd
time="2020-03-25T08:15:24+01:00" level=info msg="Executing: [/bin/sh -c lsof -n -P -p $(pgrep -o com.docker.supervisor)]" type=cmd
time="2020-03-25T08:15:24+01:00" level=info msg="Executing: [/bin/sh -c lsof -n -P -p $(pgrep -o com.docker.vpnkit)]" type=cmd
time="2020-03-25T08:15:24+01:00" level=info msg="Executing: [/bin/sh -c lsof -n -P -p $(pgrep -o com.docker.vmnetd)]" type=cmd
time="2020-03-25T08:15:24+01:00" level=warning msg="[/bin/sh -c lsof -n -P -p $(pgrep -o com.docker.vmnetd)] exit status 1" type=cmd
time="2020-03-25T08:15:24+01:00" level=warning msg="kubernetes context cannot be reached. Ignoring gatherer:version" type=kubectl
time="2020-03-25T08:15:24+01:00" level=warning msg="kubernetes context cannot be reached. Ignoring gatherer:configget-contexts" type=kubectl
time="2020-03-25T08:15:24+01:00" level=warning msg="kubernetes context cannot be reached. Ignoring gatherer:configcurrent-context" type=kubectl
time="2020-03-25T08:15:24+01:00" level=warning msg="kubernetes context cannot be reached. Ignoring gatherer:getnodes" type=kubectl
time="2020-03-25T08:15:24+01:00" level=warning msg="kubernetes context cannot be reached. Ignoring gatherer:getnamespaces" type=kubectl
time="2020-03-25T08:15:24+01:00" level=warning msg="kubernetes context cannot be reached. Ignoring gatherer:describenodes" type=kubectl
time="2020-03-25T08:15:24+01:00" level=warning msg="kubernetes context cannot be reached. Ignoring gatherer:describepods" type=kubectl
time="2020-03-25T08:15:24+01:00" level=warning msg="kubernetes context cannot be reached. Ignoring gatherer:cluster-infodump" type=kubectl
time="2020-03-25T08:15:24+01:00" level=warning msg="kubernetes context cannot be reached. Ignoring gatherer:describeservices" type=kubectl
time="2020-03-25T08:15:24+01:00" level=warning msg="kubernetes context cannot be reached. Ignoring gatherer:describestorageclass,pv,pvc" type=kubectl
time="2020-03-25T08:15:24+01:00" level=info msg="Gathering: log/vm" type=directory
time="2020-03-25T08:15:24+01:00" level=info msg="Gathering: log/vm/diagnose.out.log" type=file
time="2020-03-25T08:15:24+01:00" level=info msg="Gathering: log/vm/docker.log" type=file
time="2020-03-25T08:15:24+01:00" level=info msg="Gathering: log/vm/docker.log.0" type=file
time="2020-03-25T08:15:24+01:00" level=info msg="Gathering: log/vm/docker.log.1" type=file
time="2020-03-25T08:15:25+01:00" level=info msg="Gathering: log/vm/docker.log.2" type=file
time="2020-03-25T08:15:25+01:00" level=info msg="Gathering: log/vm/docker.log.3" type=file
time="2020-03-25T08:15:25+01:00" level=info msg="Gathering: log/vm/docker.log.4" type=file
time="2020-03-25T08:15:25+01:00" level=info msg="Gathering: log/vm/docker.log.5" type=file
time="2020-03-25T08:15:25+01:00" level=info msg="Gathering: log/vm/docker.log.6" type=file
time="2020-03-25T08:15:25+01:00" level=info msg="Gathering: log/vm/docker.log.7" type=file
time="2020-03-25T08:15:25+01:00" level=info msg="Gathering: log/vm/docker.log.8" type=file
time="2020-03-25T08:15:25+01:00" level=info msg="Gathering: log/vm/docker.out.log" type=file
time="2020-03-25T08:15:25+01:00" level=info msg="Gathering: log/vm/host-timesync-daemon.log" type=file
time="2020-03-25T08:15:25+01:00" level=info msg="Gathering: log/vm/kmsg.log" type=file
time="2020-03-25T08:15:25+01:00" level=info msg="Gathering: log/vm/kubelet.log" type=file
time="2020-03-25T08:15:25+01:00" level=info msg="Gathering: log/vm/lifecycle-server.log" type=file
time="2020-03-25T08:15:25+01:00" level=info msg="Gathering: log/vm/lifecycle-server.log.0" type=file
time="2020-03-25T08:15:25+01:00" level=info msg="Gathering: log/vm/lifecycle-server.log.1" type=file
time="2020-03-25T08:15:25+01:00" level=info msg="Gathering: log/vm/lifecycle-server.log.2" type=file
time="2020-03-25T08:15:25+01:00" level=info msg="Gathering: log/vm/lifecycle-server.log.3" type=file
time="2020-03-25T08:15:25+01:00" level=info msg="Gathering: log/vm/lifecycle-server.log.4" type=file
time="2020-03-25T08:15:25+01:00" level=info msg="Gathering: log/vm/lifecycle-server.log.5" type=file
time="2020-03-25T08:15:25+01:00" level=info msg="Gathering: log/vm/lifecycle-server.log.6" type=file
time="2020-03-25T08:15:25+01:00" level=info msg="Gathering: log/vm/lifecycle-server.log.7" type=file
time="2020-03-25T08:15:25+01:00" level=info msg="Gathering: log/vm/lifecycle-server.log.8" type=file
time="2020-03-25T08:15:25+01:00" level=info msg="Gathering: log/vm/lifecycle-server.out.log" type=file
time="2020-03-25T08:15:25+01:00" level=info msg="Gathering: log/vm/memlogd.log" type=file
time="2020-03-25T08:15:25+01:00" level=info msg="Gathering: log/vm/onboot.000-metadata.log" type=file
time="2020-03-25T08:15:25+01:00" level=info msg="Gathering: log/vm/onboot.004-format.log" type=file
time="2020-03-25T08:15:25+01:00" level=info msg="Gathering: log/vm/onboot.005-extend.log" type=file
time="2020-03-25T08:15:25+01:00" level=info msg="Gathering: log/vm/onboot.007-swap.log" type=file
time="2020-03-25T08:15:25+01:00" level=info msg="Gathering: log/vm/onboot.007-swap.out.log" type=file
time="2020-03-25T08:15:25+01:00" level=info msg="Gathering: log/vm/onboot.008-mount-docker.log" type=file
time="2020-03-25T08:15:25+01:00" level=info msg="Gathering: log/vm/onboot.009-mount-kube-images.log" type=file
time="2020-03-25T08:15:25+01:00" level=info msg="Gathering: log/vm/onboot.010-bridge.log" type=file
time="2020-03-25T08:15:25+01:00" level=info msg="Gathering: log/vm/sntpc.log" type=file
time="2020-03-25T08:15:25+01:00" level=info msg="Gathering: log/vm/sntpc.out.log" type=file
time="2020-03-25T08:15:25+01:00" level=info msg="Gathering: log/vm/socks.out.log" type=file
time="2020-03-25T08:15:25+01:00" level=info msg="Gathering: log/vm/trim-after-delete.log" type=file
time="2020-03-25T08:15:25+01:00" level=info msg="Gathering: log/vm/vpnkit-forwarder.log" type=file
time="2020-03-25T08:15:25+01:00" level=info msg="Gathering: log/host" type=directory
time="2020-03-25T08:15:25+01:00" level=info msg="Gathering: log/host/com.docker.backend.log" type=file
time="2020-03-25T08:15:25+01:00" level=info msg="Skipping empty file: log/host/com.docker.diagnose.log" type=file
time="2020-03-25T08:15:25+01:00" level=info msg="Gathering: log/host/com.docker.driver.amd64-linux.log" type=file
time="2020-03-25T08:15:25+01:00" level=info msg="Gathering: log/host/com.docker.driver.amd64-linux.log.0" type=file
time="2020-03-25T08:15:25+01:00" level=info msg="Gathering: log/host/com.docker.driver.amd64-linux.log.1" type=file
time="2020-03-25T08:15:25+01:00" level=info msg="Gathering: log/host/com.docker.supervisor.log" type=file
time="2020-03-25T08:15:25+01:00" level=info msg="Skipping empty file: log/host/docker-credential-desktop.log" type=file
time="2020-03-25T08:15:25+01:00" level=info msg="Gathering: log/host/vpnkit-bridge.log" type=file
time="2020-03-25T08:15:25+01:00" level=info msg="Executing: [ls -l /Users/ramirojgc/Library/Containers/com.docker.docker/Data/vms/0/data/Docker.raw]" type=cmd
time="2020-03-25T08:15:25+01:00" level=info msg="Skipping empty file: /Users/ramirojgc/Library/Group Containers/group.com.docker/DockerAppStderr.txt" type=file
time="2020-03-25T08:15:25+01:00" level=info msg="Gathering: /Users/ramirojgc/Library/Group Containers/group.com.docker/already-enabled-features.json" type=file
time="2020-03-25T08:15:25+01:00" level=info msg="Gathering: /Users/ramirojgc/Library/Group Containers/group.com.docker/dhcp.json" type=file
time="2020-03-25T08:15:25+01:00" level=info msg="Gathering: /Users/ramirojgc/Library/Group Containers/group.com.docker/features.json" type=file
time="2020-03-25T08:15:25+01:00" level=info msg="Gathering: /Users/ramirojgc/Library/Group Containers/group.com.docker/http_proxy.json" type=file
time="2020-03-25T08:15:25+01:00" level=info msg="Gathering: /Users/ramirojgc/Library/Group Containers/group.com.docker/settings.json" type=file
time="2020-03-25T08:15:25+01:00" level=warning msg="/Users/ramirojgc/Library/Preferences/group.com.docker.plist not included" type=file
time="2020-03-25T08:15:25+01:00" level=warning msg="exit status 1" type=directorylist
time="2020-03-25T08:15:25+01:00" level=info msg="Gathering: /Users/ramirojgc/.docker/config.json" type=redacted-json
time="2020-03-25T08:15:25+01:00" level=info msg="Gathering: /Users/ramirojgc/.docker/daemon.json" type=redacted-json
time="2020-03-25T08:15:25+01:00" level=info msg="HTTP GET: localhost /fuse/time" type=http
time="2020-03-25T08:15:25+01:00" level=info msg="HTTP GET: localhost /fuse/count" type=http
time="2020-03-25T08:15:25+01:00" level=info msg="HTTP GET: localhost /fuse/filename" type=http
time="2020-03-25T08:15:25+01:00" level=info msg="HTTP GET: localhost /fuse/calls" type=http
time="2020-03-25T08:15:25+01:00" level=info msg="Getting Linux Diagnostics via a unix socket: diagnosticd.sock" type=unixsock
time="2020-03-25T08:16:11+01:00" level=info msg="All 80 gatherers finished" type=list

Steps to reproduce the behavior

Activity

  1. cculianu commented on Mar 30, 2020

    @cculianu

    Happens to me too. I get about 20% CPU usage on my i9 macbook pro. It is just started, no containers running. The com.docker.hyperkit process just eats CPU every few seconds, spiking it up to like 20%. Then it goes to sleep and a few seconds later, the cycle repeats.

    It causes the machine to heat up, fans to whirr, and for it to consume power needlessly.

  2. dnguyenv commented on Apr 2, 2020

    @dnguyenv

    +1. Wondering if this is fixed in the recently released 2.2.0.5?

  3. engstrom commented on Apr 2, 2020

    @engstrom

    +1. Wondering if this is fixed in the recently released 2.2.0.5?

    2.2.0.5 did not resolve the issue on my MacBook Pro (15-inch, 2017) running Catalina (10.15.3).

  4. cculianu commented on Apr 3, 2020

    @cculianu

    Nope, not resolved for me either. Docker just started 5 minutes ago. No containers running. It .. just sits there eating CPU for no reason.

    CPU Use

    Screen Shot 2020-04-03 at 10 17 22 AM

    Energy Impact

    Screen Shot 2020-04-03 at 10 20 07 AM


    Mind you this is on a very fast i9 16 core system. 7% CPU use on one of these cores is like 25% on your typical i5 or i7.

    I'm a C++ programmer. I go way back to the early 2000's. C or C++ programs that wake up randomly and churn the CPU that hard are programs I would consider broken and needing to be rewritten.

    Go programs should be no different.

    Docker likely wakes up and does some crazy mundane tasks every few seconds. Or maybe it's just the Go gc?

    The devs should see about tuning the Go GC to not do that.

    Edit:

    I just want to add I just tried watching a random HD video on YouTube on the same system. Docker is using about as much CPU when idle as YouTube is while decoding an HD video. Is that acceptable?

  5. zendraxl commented on Apr 3, 2020

    @zendraxl

    Same issue.

  6. nebuk89 commented on Apr 6, 2020

    @nebuk89

    hey all,

    we will try and roll this into our upcoming CPU investigation but as highlighted on #12 this is likely a separate issue from the symptoms.

    @cculianu

    The com.docker.hyperkit process is a C program. If the disk is a qcow (if the system doesn't have APFS on an SSD) then there is also ocaml.
    However the ocaml heap is probably not that big.
    There's probably a command to introspect it's size (something like 'pmap -x pid' on Linux) to check this.... I would need to get a bit more help from the team to dig into this further to see if giving y'all a set of instructions to do self diagnostics on this is going to help you or something we should wait for us being a bit more ready to engage with :)

  7. cculianu commented on Apr 6, 2020

    @cculianu

    Ah ok, C. Cool. Yeah I'm ok to try whatever you want. Thanks for looking into it!

  8. UgurGumushan commented on Apr 7, 2020

    @UgurGumushan

    I have the same problem. I disabled kubernetes, debug mode and experimental features and the cpu usage went from 50% to ~7% - I have 3 running containers and they are idle.

  9. fuatkarakus commented on Apr 11, 2020

    @fuatkarakus

    Same issue.
    Docker version 19.03.8, build afacb8b
    Docker Desktop version 2.2.0.5 (43884)
    Macos version 10.13.6

  10. petre-s commented on Apr 29, 2020

    @petre-s

    Same issue, also I tried a factory reset and there is no change. ~13% CPU usage without any containers running.

  11. dietervdw-spotify commented on May 7, 2020

    @dietervdw-spotify

    How about 140% cpu usage? No containers running.

    image

  12. xjrcode commented on May 29, 2020

    @xjrcode

    In macOS the process with hight CPU usage with no containers is hyperkit:
    image

    Version 2.3.0.3 (45519)

  13. canavjoh commented on Jun 10, 2020

    @canavjoh

    Consistent ~270% CPU usage from hyperkit process here with no containers running.
    Same behaviour across multiple versions of Docker for Mac.

    image

    Diagnostics: D2670972-669C-4233-A35C-92CF0AE2598F/20200610194159

  14. 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.

  15. WimCools commented on Jun 27, 2020

    @WimCools

    On my Mac the CPU is consumed by mDNSResolver once docker-desktop is started (even when no containers are running).

  16. stephen-turner commented on Aug 21, 2020

    @stephen-turner
    Contributor

    I'm going to dupe this against the main CPU ticket, #3499. I've just posted a new build there that you can try.

  17. 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

  18. 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