Closed robd003 closed 3 years ago
This issue persists even hours after the VM has been started. It seems like high CPU usage never stops for kube-apiserver and kubelet
I think this is known, and the workaround is to use minikube pause
when it is not in use.
It would be great if we could change the default kubernetes polling intervals to something less aggressive. Maybe only look for updates once every 5 or 10 seconds?
@robd003 @devZer0 have you tried our Auto-Pause addon (currently only available on Docker Driver)
minikube addons enable auto-pause
@medyagh The problem is that it's burning a ton of CPU while doing effectively nothing which wastes battery power on a laptop. It'd be great if we could tune kubernetes for minikube so that it would poll once a second rather than every 5ms.
@robd003 @devZer0 have you tried our Auto-Pause addon (currently only available on Docker Driver)
minikube addons enable auto-pause
no, i don't think this is an option.
i agree to @robd003 , i think it needs to be clarified if it's a bug or a feature, that minikube burns significant amount of cpu when idle/doing nothing - and if there can't be done something about it.
i know that there exists software which needs to use polling or similar for performance reason , but i really wonder if this is necessary for a container orchestration platform, especially when this is the "micro version" of such, which is especially meant for developers and often runs on battery powered devices.
burning cpu on laptop is not only wasting energy, it's avoilable stressing the device and it's battery, especially in summer. we have tons of laptops in our company which need service because of battery defects and the less software putting stress on battery, the longer they will last...
furthermore, we're in 2021 and i think we cannot affort wasting precious energy at a large scale, and kubernetes is software used at large scale, so we may have some tons of co2 which could be saved...
so when kubernetes (& derivates) are wasting energy by default and nobody can explain why this is really needed (i.e. intentional) - then we all should put work into this to adress that.
from my experience there often is lot's of inefficiency in big software stacks, and that's mostly because such stuff runs on big iron (where it doesn't matter) and/or nobody has time or knowledge (or even dares) to really have a close look.
@robd003 @devZer0 have you tried our Auto-Pause addon (currently only available on Docker Driver) minikube addons enable auto-pause
no, i don't think this is an option.
i agree to @robd003 , i think it needs to be clarified if it's a bug or a feature, that minikube burns significant amount of cpu when idle/doing nothing - and if there can't be done something about it.
i know that there exists software which needs to use polling or similar for performance reason , but i really wonder if this is necessary for a container orchestration platform, especially when this is the "micro version" of such, which is especially meant for developers and often runs on battery powered devices.
burning cpu on laptop is not only wasting energy, it's avoilable stressing the device and it's battery, especially in summer. we have tons of laptops in our company which need service because of battery defects and the less software putting stress on battery, the longer they will last...
furthermore, we're in 2021 and i think we cannot affort wasting precious energy at a large scale, and kubernetes is software used at large scale, so we may have some tons of co2 which could be saved...
so when kubernetes (& derivates) are wasting energy by default and nobody can explain why this is really needed (i.e. intentional) - then we all should put work into this to adress that.
from my experience there often is lot's of inefficiency in big software stacks, and that's mostly because such stuff runs on big iron (where it doesn't matter) and/or nobody has time or knowledge (or even dares) to really have a close look.
@devZer0 @robd003 I agree with you, it is a shame how much energy we waste and contributing to the global warming, during past year we tried in minikube and reduce the CPU by more than 50% We identified the exact components of kubernetes that use most CPU, Priya Wadwha has a great talk about how we did that https://www.youtube.com/watch?v=tvreJem3xIw
but that is still not enough thats why we started a new feature on auto-pause (currently only on docker/podman driver) you could use it on the minikube v1.19.0-beta0
the binaries for the beta release can be found here
https://storage.googleapis.com/minikube/latest/minikube-linux-amd64
The current design of auto-pause pause kubernetes when it is not in use, I would love love to hear your feedback of Auto-Pause addon ! if you wanted to give it a try and let me know (on minikube v1.19.0-beta0+) here is how to enable it
minikube start
minikube addons enable auto-pause
@devZer0 @robd003 have you had a chance to try minikube latest binary for the Auto-pause addon on VM Drivers?
curl -LO https://storage.googleapis.com/minikube/latest/minikube-linux-amd64
sudo install minikube-linux-amd64 /usr/local/bin/minikube
minikube delete --al
minikube start
minikube addons enable auto-pause
@medyagh Yes I've tried the latest build; however, the problem isn't pausing kubernetes, but rather the high CPU usage when it's running. There's got to be a way to de-tune it and have polling happen once every 500ms - 1000ms instead of constantly pegging the CPU when running on a developer laptop.
I have no problem shutting down kubernetes when I don't need it. The issue that persists is kubernetes high load when doing the bare minimum of tasks.
i see it the same way as @robd003
the problem for me is not shutting it down , pausing or suspending. i could also pause/suspend the virtual machine.
minikube should not burn cpu when mostly idle.
if there is polling at a high rate it should be explained why it is absolutely necessary and if reducing polling rate could be a reasonable approach to lower cpu usage, then it should be made a tunable for developer laptops or lower-end machines.
unfortunately the CPU usage of Kuberentes itself is can not be changed by minikube, for that I strongly suggest creating an issue on kubernetes itself
meanwhile we have published bechmarks on minikube CPU usage which currently is at 9% at highest.
on linux https://minikube.sigs.k8s.io/docs/benchmarks/cpuusage/linux/ on mac os https://minikube.sigs.k8s.io/docs/benchmarks/cpuusage/macos/
with and without auto-pause
I will close this issue but please open again if anything on minkube side can be done. but I would love this discussion to be followed up in https://github.com/kubernetes/kubernetes
Steps to reproduce the issue:
CPU usage is never less than 50% for the duration that the hyperkit VM runs. Still have the same problem as https://github.com/kubernetes/minikube/issues/3207 however this is on macOS Big Sur 11.2.2 and running minikube v1.17.1
Optional: Full output of
minikube logs
command: