-
Notifications
You must be signed in to change notification settings - Fork 773
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
kubelite process takes huge amount of CPU #2186
Comments
I'm facing the same issue and I'm using Ubuntu 18.04. |
@muxi from the tarball you provided, i can see that kubelite is not healthy, leading it to crashloop. That's why it is using up that much cpu. But i couldn't determine what is causing it to crashloop. |
@balchua thanks for looking into it. For now I am just reverting to v1.20.5 which works for me. If anything else I can provide to help with debugging this problem let me know. |
When you install 1.20.5 did you purge the snap? |
Did you mean 1.20.5 or 1.21? The install of 1.21 was (surprisingly) automatically done by |
Hi @muxi i can see that you are using the channel |
i face the same after upgrading to 1.21/edge especially the CPU usage is concerning with averaging around 10% in test with much less pods then our productin system (1.19/stable) kube-apiserver with averaging on 2% cpu load. Memory consumption is around 20% higher too.
|
Its hard to compare kubelite with the kube-apiserver alone. Kubelite packs in all the kubernetes components into 1 binary. @ktsakalozos thoughts? |
@balchua is right, in terms of CPU load it is the sum of all k8s services and the datastore (dqlite). In terms of memory usage it should be about 200MB less than the total memory used by a setup where each service starts by its own. |
@balchua @ktsakalozos having a look for the last 7 days on to the avg and max CPU consumption of our test setup it actually looks like that overall the CPU consumption slightly dropped. Its at first without the explenation from @balchua surprising to see kubelite in top poping up, but overall there seems to be no real visible increase and maybe even a slight drop. Once 1.21.1 is released we will upgrade it in our prod environment. |
I'm also seeing the CPU usage which I understand is a crash loop. It prevents me from starting microk8s after rebooting and stopping it. The issue is probably that in snap |
@krichter722 yes you are right, kubelite is crashlooping with this error.
Is this a new setup or its an upgrade from previous version? Maybe @ktsakalozos or @MathieuBordere can shed more light on this one. |
The issue occurred after upgrading to 1.21 with a long running instance running 1.20 which might have been upgraded before. A fresh install of 1.21 as well and 1.20 works (smoke test So, the issue is "resolved" for me by purging the microk8s snap installation and reinstalling, however light should be shed on the revision numbers as well as issues with an upgrade of an installation which is not freshly installed from 1.20 to 1.21. |
Thank you @krichter822 for the information. The revision number is normal. I think the v 1.20.6 came out after the 1.21/stable was cut. |
I am facing similar - and worse - issue. Not only the CPU consumption of kubelite is between 70%-130%, it takes microk8s minutes to get to start (after which it stabilizes on ~70% CPU), AND kubelite consumes 22-23GB which is >70% of my machine. |
@tsipo thank you for providing the inspect tarball.
Can you try adding the following
to these files |
@balchua Thanks for your prompt reply, it's unfortunately too late. I have already purged the previous installation of microk8s and installed the same version (I'm on latest/edge channel) anew. Now no problems - CPU consumption is reasonable, same is memory consumption (down to a few hundreds of MBs). So the issue was surely with the upgrade path from previous version to current on that channel. |
Hi @tsipo thanks for giving us an update. If ever you find something strange feel free to create an issue. |
Hi, I got the same problem with microk8s 1.21 running on debian 11 testing : When it autoupgraded to 1.21, I had to upgrade to debian 11 otherwise it wouldn't start. Kernel version now is 5.10.0-7-amd64 #1 SMP Debian 5.10.40-1 (2021-05-28) x86_64 GNU/Linux I'm running only one node and already tried to purge the cluster as mentioned above (pain in the ... to reinstall everything and what a pitty, didn't solve the problem).
|
Same problem here. I'm using a fresh Ubuntu 20.04 install. This is my version (snap): Client Version: version.Info{Major:"1", Minor:"21+", GitVersion:"v1.21.1-3+ba118484dd39df", GitCommit:"ba118484dd39df570e55e47f082e523cda7583e5", GitTreeState:"clean", BuildDate:"2021-06-11T05:09:28Z", GoVersion:"go1.16.5", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"21+", GitVersion:"v1.21.1-3+ba118484dd39df", GitCommit:"ba118484dd39df570e55e47f082e523cda7583e5", GitTreeState:"clean", BuildDate:"2021-06-11T05:06:35Z", GoVersion:"go1.16.5", Compiler:"gc", Platform:"linux/amd64"} |
I experienced rather high CPU consumption with a DNS forward loop as well on 1.21 after the crash loop mentioned above was no longer an issue for me. I set up calico and a IPv4+6 dual stack, but I don't see why this might not happen with other setups as well, e.g. if your ISP provides strange DNS settings. Therefore I needed to add For me the issue was a huge amount of probe failures which also contributed to the high CPU usage which then probably lead to even more probe failures, but this issue might be worth taking a look at when investigating high CPU usage. |
hi, is any one knows after upgrading to my k8s cluster into v1.21 was this kubelite process issue have to deal with the kernel versions I'm having in my Ubuntu O/S ? Because i'm getting this cpu 100% issue only in a one node of my microk8s cluster (which has a higher kernel version when comparing with other nodes). All other nodes are fine. tnx |
Just installed microk8s 1.22 stable on ubuntu via snap, and top reports 10-30% cpu for kubelite on an i3, 4 core, 2GHz. Would it make sense to try the above suggestion: |
For the record, both files referred to above, kube-controller-manager and kube-scheduler in directory /var/snap/microk8s/current/args, |
I also came across this issue because I was wondering about relatively high CPU usage from the Kubelite process. I have about 20-30% load on idle after a fresh install. (dns, storage, ingress enabled) |
@YpeKingma the resource usage will be related to the intensity of workloads running in Kubernetes. |
@AlexsJones There were no workloads scheduled. |
@YpeKingma it would also help us know the hardware specs and the version of kubernetes you run. Would you be able to attach a |
duplicate #3026 |
I'm also experiencing this. I have microk8s running but with literally nothing to do (idle), so it's CPU/memory usage should be extremely minimal. Nonetheless, I find it consistently using 20% of my CPU. As a temporary fix, you can stop microk8s and restart it when you actually need it. It goes without saying that this should not be necessary for a user to do. |
Looking at |
Have you run |
So |
Adding to this, I'm also seeing similar metrics: 20-40% CPU usage with nothing actually running on the cluster, |
Same here with Ubuntu 22.04 on Raspberrypi 4 model B 4GB with three nodes HA enabled. |
For purposes of local development and testing I have switched from Microk8s to Kind, for this reason among others. |
Yes but what about people wanting to use it in production ? |
HA enabled, you mean a control-plane on two nodes and third as worker or all three running as the control-plane? |
Hi, I used the following tutorial : https://ubuntu.com/tutorials/getting-started-with-kubernetes-ha?&_ga=2.187560111.665053589.1668255625-380658086.1668255625#1-overview So I think the control plane is running on all the three nodes |
I have same problem, kubelite is running near 100% CPU. Ok, I was cheap and ran master Rasbi 3. I just set it up running version 1.23 as 1.25 did not work with it claiming cgroups were in enabled. There are no containers deployed and it can barely cope with 1 node joining. kubelite at 75% and next ones are containerd 15+10% , sometime dblite jumps up. |
Hi @mikezerosix
Control plane nodes are also registered as workers by default, a work-around to prevent workloads from being scheduled there are to drain and taint the control plane nodes with:
Also, can you share an inspection report so that we can have a look at it? |
I have the same issue. Installed recently on Ubuntu 22.04. Running on a VM with 6 cores and 32gb of ram. The 2 main processes eating cpu are Any idea how to resolve this? |
Hi @augusto Kubernetes services (API server, proxy, kubelet, scheduler, controller manager) will always produce in idle. For example the K8s services (all under kubelite) will constantly query the state of the cluster so as to figure out if there is work for them to do. Depending on the hardware you are running MicroK8s on 20% may be expected. Could you share a |
@ktsakalozos How frequent will the polling be? May the user adjust the frequency of polling? |
I see the same thing on microk8s 1.27 on ubuntu 23
this is on a must say that using ~20% cpu 24/7 is not really ideal |
@fybmain @masterkain I am not aware of any way to tune the frequency k8s services (many) check for state changes. But it seems a reasonable ask. Maybe upstream kubernetes has an answer. For sure if there is a way to tune this, MicroK8s you can do it in MicroK8s. The percentages we are talking about here or on one core, right? What tool do you use to measure them? |
@ktsakalozos thanks for the reply -- nothing fancy, just a quick glance at |
Sorry for the late reply @ktsakalozos ! I've torn down the microk8s vm I had. Not sure if this is of any use, but I installed K3s and out of the box the CPU utilisation was ~10% (compared to ~20% in microK8s after removing HA). Somehow K3s manages to use 50% less CPU than microk8s. |
Great, thanks, I had the same problem with ubuntu server 2204 LTS , and purge solved it. Saw that microk8s used more than 500% cpu on htop. |
Hi, any update on that topic? It is quite sad that problem has more than 3 years and it is still not solved. |
After getting the 1.21 package from Debian 10 repo, the
kubelite
process is eating up a lot of CPU. The process keep using >100% CPU intop
and the average uptime load is ~2 instead of <1 in previous versions.inspection-report-20210420_092101.tar.gz
The text was updated successfully, but these errors were encountered: