Agree, but the actual issue were the SQL sensors going haywire after the database changes. @Wilber’s post above is spot on in showing what’s been going on and how to correct the SQL queries.
I don’t know if only the size of the database matters. I completely killed my database and my CPU usage is still high. Waited almost more than an hour.
In my case after upgrade to 2023.4.0 HA is working with db more than 24h, my db is about 2,2GB handled by mariadb, CPU from 25% used, now is oscilating 50-60%, SSD read since upgrade grew by 1,5TB, ssd write by 60GB and it is still working on that db.
Im at 4.1 and the CPU still high after 16 Hour. The sql server is on different machine and it take about 30min to see the CPU high there. Now SQL server cpu seems settled by home assistant still using more that double cpu. I dont think it has anything to do with DB anymore. 3% vs 8% now.
Well managed to fix after disable localtuya, full OS reboot, reenabled localtuya. (There is some error in log about localtuya)
I hope everyone else got fix.
I have the same issue, high cpu after the april update. It’s been a few days (a week actually), i am on version 4.3 atm en did a full reboot. But CPU utilization of InfluxDB remains high, never experienced this before.
I do not have sql sensors or the like, hoping for a fix in a future version
Same issue here. I can’ t find the source of the problem. After all my automatons were taking 10’s of seconds to fire, I gave up and rolled back to 2023.3.6
I made purge of my database into 1 day, so it removed all history from database and reduce database size to 45MB and then CPU use went down but it is still higher than on 2023.3.6, in my case I also installed add-on glances to deeply check what is consuming my CPU - but nothing special can find, so this add-on also is taking some “cpu power”
I’m not familiar with Glances, but perhaps you could just add the following in your configuration file. I see you’re using Grafana too.
# create new sensors for HA hardware system monitoring
- platform: systemmonitor
resources:
- type: processor_use
- type: processor_temperature
- type: memory_free
- type: memory_use
- type: memory_use_percent
- type: disk_use_percent
arg: /
- type: disk_use
- type: disk_free
- type: throughput_network_in
arg: eth0
- type: throughput_network_out
arg: eth0
From presented only “processor_use” i “memory_use_percent” is working - my installation: Generic x86-64 HAOS.
Glances is nice but it is taking quite huge resources.
For me the killers were InfluxDB and Grafana, since I removed them it’s all back to normal. My disk was 100% busy, response times went up to 45000 micro seconds, now is below 10 again. Did not install the addins back as I use HACS cards instead of grafana lately. Hope it helps some of you.
I also suffer from high CPU usage since 2023.04.
Got InfluxDB and Grafana installed.
Does anyone know how to find out what causes the CPU Usage?
Is it safe to reboot when it is in this many hours long lasting post-migration step? I don’t want to break anything.
Install Glances as suggested above. I did that and found the culprit was one of the addon, namely sponsorblockcast, which was using 35% of CPU.
After removing, its back to normal.
Glances is available as an addon.
Edit: Also in the screenshot glances is using a lot of CPU, bu its just for the initial few seconds.
in my case help to remove mariadb - comment it in config restart - uninstall mariadb, install again and configure, uncoment in config and restart ha - after this from ~50% cpu I went down to 25-30%.
Tried uninstalling Maria DB and reinstalling. No luck. CPU still 35+% vs about 13-20% before
The CPU issue is back on 2023.4.6. the work around dint fix it… no idea how to fix it now .
I am stuck at 4.1 now…
I have similar issue with 2023.7.0. I have noticed that over the past few days, the graphs on my dashboard remain flat after a few hours into the backup process. Additionally, I have observed that the MariaDB component is utilizing more than 90% of the CPU. I’m also observing that the data on the graphs is being updated if I allow it to display for a moment. However, it seems that the data is not being stored in the database. When I refresh the graph, it displays a flat line and starts updating the data from that point onward.
Same graph but after refresh the page:
After a reboot, everything returns to normal. However, data from this occurrence is not saved in the database, resulting in flat lines on the graphs. Data is started to being stored after the reboot. But The issue happens again after the backup process start again.
This last time I haven’t rebooted it. I’ts been more than 24% and the CPU is at 95% and MariaDB is using around 90%.
Did you get this solved or is your cpu usage back to normal on its own?
After upgrading to 2023.10.0 I have MariaDB using two (of twelve) cores all the time - for weeks now. DB is @17GB (keep_days 400) and it seems nothing gets recorded since the update (all history is flat until you leave the popup open, then stats are pouring in; being gone after closing the graph).
How can I check what MariaDB is doing behind the scenes?
no really, I just wiped my server and installed again, then restore it with a back up.
2023.4 update made my load increase like crazy. After restarting HA it takes only few minutes and it is up again. System VERY slow and laggy, close to completely unusable.
Details: 2023.4: Custom template macros, and many more new entity dialogs! - #620 by e-raser
Any ideas? Database tasks should be finished already, it’s been almost 6 hours now since updating…! Makes me totally crazy
edit: updated the linked post, seems to be resolved (hopefully).