High CPU usage since December, how can I check what is causing it?

Hi,

Since December, my CPU usage has increased by a factor of 6. After a reboot, it briefly drops to normal levels, but then increases and stays high.

It’s been a long time since I made any major changes to HA or added anything new, certainly longer than December.

Is there any way to check what is causing the CPU usage?

This is the CPU usage from August to today. It went up from 5% to 30% in mid-December.
image

Due to the high CPU use it is probably not this, but if you use the CPU Speed integration it may be worth checking.

Otherwise, start disabling integrations one by one (third party integrations first) until you find which has an effect.

Also try reloading automations to make sure it is not a rogue loop.

Unfortunately that’s not it.
Is there no way to check the CPU usage and see what’s causing it? I’d like to avoid disabling one integration at a time.

Yes there are a couple of ways but they are not easy to interpret.

Profiler Scan (this will work better after 2024.2 is released with Python 3.12 support as it will show the thread info). But is still worth trying now:

Also Py-Spy.

Run the scan and ask for help interpreting the results in this topic if you need it:

1 Like

The profiler looks very interesting. As we are only a few days away from 2023.02, I’ll just wait for the update. After all, it has been running like this for over a month now.

I’ll come back here and let you know if it helped when the update is released.

Thanks for the quick answers!

I have found out what is causing the CPU load. After doing a backup, it jumps from 5% to 30% CPU load and stays there until I restart HomeAssistant.

I run HA as a VM in Proxmox and do daily backups. I’ve tried snapshot and stop mode but it happens both ways.

Is there anything I can do about this? Is it possible to create a rule in HA to reboot at a set time?

Rather than doing that report the issue so it gets fixed.