docker / for-mac

Bug reports for Docker Desktop for Mac
https://www.docker.com/products/docker#/mac
2.43k stars 117 forks source link

Energy Usage on OSX #4323

Open dylanz opened 4 years ago

dylanz commented 4 years ago

Expected behavior

Running Docker Desktop with no running containers, and Running Docker Desktop/Kubernetes with no running applications, should not have such a high Energy Impact on OSX.

Actual behavior

The Energy Impact on OSX is quite high even with no containers running.

Information

Running just Docker Desktop docker

Running Docker Desktop and Kubernetes docker with kubernetes

... in both cases, no containers are running container status

Diagnostic logs

Docker for Mac: 2.2.0.3 (42716)

Steps to reproduce the behavior

  1. Install Docker Desktop
dylanz commented 4 years ago

Side anecdote: after spinning down my local Kubernetes cluster, about an hour later and docker ps still shows no containers running, my machine started getting super loud/hot and Activity Monitor showed this:

kubernetes memory use

Some more detail on the specs of the machine I'm working on: local machine

cculianu commented 4 years ago

I see the exact same thing on my system. Consistently. No containers are running. com.docker.hyperkit eating 20% CPU every few seconds all day, every day, for no reason.

AzaubaevViktor commented 4 years ago

The same

Radren commented 4 years ago

I've had the same situation since last week, started suddenly

cramhead commented 4 years ago

Same on docker desktop 2.3.0.2(45183) with macOS 10.15.4

StefanSchubert commented 4 years ago

Same on Docker Desktop 2.3.0.3 (45519) with macOS 10.15.5 I have given Docker only 2 CPUs but the machine ist still getting hot. I regret to have performed the latest update :-(

Please fix this.

Thanks for the docker port Stefan

Rykus0 commented 4 years ago

Same here. Energy impact is around 440 (other apps peak around 25, normally around 2-3). I can't keep docker running. My battery drains when plugged in.
Problem is, when I close docker, my apps have a hard time coming back up after restart.
Plan is to move away from Docker, in part because of this, but wanted to give this another bump.

image
Radren commented 4 years ago

I updated OS a couple of times (out off laptop now, can't check the version), it solved energy issues.

acyuta commented 4 years ago

Same situation. com.docker.hyperkit eats a lot of energy.

nkarim496 commented 4 years ago

same here

infolock commented 3 years ago

Ditto. My energy impact is insane with docker running. My Laptop (while plugged in) can be at 100% with docker not running. When I start docker. I can watch the % just drop. in 2 hours time, it went from 100% to 71% (this is while still plugged in).

Screen Shot 2020-11-10 at 4 35 14 PM

I'm not sure what to do. I've tried new AC adapters and everything hoping this was just a mac problem, but it isn't. Just as soon as Docker is closed, I can watch my battery % go back up. Not sure what to do about this either =\

FWIW, I'm currently on v19.03.13. I've been updating it any time a new update comes in. This has been a problem since earlier this year I want to say.

infolock commented 3 years ago

The other thing I have found is this.

I'm not sure if the Docker gods agree, but this seems to either be working as expected (depending on the CPUs setting) or Docker is taking WAY more resources than it actually needs simply because we've given it access to those things.

Not sure which they'll go with, but I'm betting it's door number 1

Either way, this doesn't resolve the issue of the battery being drained. Even with CPU's set to 1 and lowering the energy impact to the 100's level, my battery continues to drain. Closing Docker though - results in battery being charged. =\

simone-baldini commented 3 years ago

Same here, please fix this.

pipozzz commented 3 years ago

Same problem for me :(

cculianu commented 3 years ago

They're never going to fix this. I have given up. I just load up docker, use it for what I need, then quit it immediately when my containers are done. Don't leave docker running -- you will have a bad time.

Aniket-Singla commented 3 years ago

It got even worsen on my mac after updating to big sur.

sunbit-zackz commented 3 years ago

Did anyone found a workaround yet? something to at least slow the discharge rate? I heavily rely on docker and this keeps me from working...

infolock commented 3 years ago

There is no workaround. I mean - you could change the CPU value to 1 - but then you may (like me) find that your containers no longer work.

The only option I personally have found is to do this:

I know the above sounds obvious... but unfortunately there seriously isn't much else you can do until they get this fixed.

Again - the same issue was raised almost a month ago in this ticket and they closed it. The current ticket has been opened since Feb so that's good news at least. Both are related to the HIGH CPU usage & the HIGH ENERGY usage.

infolock commented 3 years ago

Good news. Sounds like they may have finally tracked down the issue and are addressing it in #5044 (as mentioned in the last comment on #5070 )

infolock commented 3 years ago

FWIW I also recently discovered that the AC Adapter provided to me for my Macbook is a 61W where the needed one is a 87W min. While that solves the issues surrounding the battery being drained while docker is open, it doesn't resolve the fundamental issue with docker having a 240+ energy impact (which is roughly 20x+ more than the average application). not sure if there is anything that can even be done about it - but if it can, it should.

docker-robott commented 3 years ago

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

hannahchan commented 3 years ago

/remove-lifecycle stale

hhimanshu commented 3 years ago

I have same issue for months

korbin-up commented 3 years ago

Same here...

korbin-up commented 3 years ago

/remove-lifecycle stale

bramses commented 3 years ago

/remove-lifecycle stale

xiliuStrateos commented 3 years ago

same here

commadelimited commented 3 years ago

My MacBook is plugged in, with Docker left running. I just noticed it was at 21%. I stopped Docker and within 2 minutes my battery was already back at 26%. The way my company is set up, we HAVE to use Docker to do our work.

vladimir-shmidt commented 3 years ago

same for me

sleoj commented 3 years ago

Same here. My Mac laptop fan comes on almost as soon as it powers up, and feels hot near the air vents while running. I’m in a Zoom meeting with the camera on, and after I quit Docker the fan shut down within minutes and the air vents are cool to the touch.

MacOS 10.15.7

aramdov commented 3 years ago

Same here on MacBook Pro 2017 running Big Sur. No docker containers running and It spikes to 15-20% CPU usage, says it has 4GB of memory, and the energy usage is the highest compared to any other app.

cscetbon commented 3 years ago

It's so annoying ... is there anyone who's working on this issue ? I've heard they've been working on it but it's been at least a year for me now with this issue ...

angelomelonas commented 3 years ago

Experiencing very high CPU and energy usage and it seems to get worse on each Docker Desktop update.

MacOS Big Sur 11.4

image

keitorin commented 3 years ago

had to open activity monitor then select CPU tab and search docker then force quit related services, the docker will not show in Using significant Energy then. And i thought quit is enough. lol fyi: my os is macOS Big Sur v11.4

cculianu commented 3 years ago

You know -- i have been in this thread for at least a year now.

I just want to say that the state of programming in general is an absolute disgrace. So many crappy developers working for big companies like Docker. Let me say this loudly and clearly: THERE IS NO EXCUSE FOR AN IDLE APP TO USE EVEN 0.1% CPU, LET ALONE 20%!!!.

You have extremely shoddy developers working for you, Docker. You suck. This is a disgrace.

ienliven commented 3 years ago

Still happening with latest docker and OSX versions to date. Incompetents

hungluu commented 3 years ago

Docker desktop keeps destroying my Macbook battery every single day :(

briceburg commented 3 years ago

I also suffer from this on a fresh 2019 MBP.

IMO it has to do with the [linux] hyperkit VM running in the background where containers get scheduled. It would be very cool if we could suspend this VM if no containers are running. Or could toggle it from the status dropdown without having to close app.

Outside of that, I've seen better battery behavior by disabling the gRPC FUSE feature for sharing files and using "legacy osx filesharing" instead.

MickL commented 3 years ago

Are there any lighter alternatives to Docker? I just need to run images like MongoDB or Redis and it slows down my whole machine and drains my battery SO fast.

JeromeDesseaux commented 3 years ago

With Docker intention to make money on Docker Desktop, it might be a good idea to fix these bugs first.

redrockltd commented 3 years ago

It's not much, but when gc is disabled and CPUs resources is set to max 2, battery consumption fall down by 90%. I regret, I figure out this after total destruction of my mac battery... OSX message (Service Recommended), and max lifetime 1h. Thank you Docker :(

image image image

docker-robott commented 2 years ago

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

hannahchan commented 2 years ago

/lifecycle frozen

hungluu commented 2 years ago

Are there any updates or plans on the improvement / fixes tho? :(

vishnun commented 2 years ago

Facing the same issue still. Hoping someone has an answer.

Screen Shot 2022-02-07 at 3 20 23 PM
vishnun commented 2 years ago

Not sure of the root cause for the battery killer state but after running docker system prune command, it stopped sucking up the batter faster than I can charge..It's no longer the highest energy impact app on my mac.

aofarrel commented 2 years ago

This seems to have gotten worse over time. My 2020 Pro which has never had any battery issues was charged to 90% when I unplugged it. One hour after unplugging it, during which time I didn't use Docker at all, I was at 15%.

Screen Shot 2022-03-18 at 12 19 30 PM
jorgt commented 2 years ago

Came here with the same issue.

notacoat commented 2 years ago

someone please fix this. i will buy you lunch.

Lorenzschaef commented 2 years ago

Same issue. 2+ years later. Is there really still no solution?