High CPU usage after 0.113

Not at all

If you upgraded from a version earlier than 0.112 then you will notice a high CPU spike while HA rebuilds the database. That can take minutes to hours depending on your machine and size of database. Once db is converted CPU load is back to normal

If have been through 0.112 then it cannot be that

My apologies - I am on 0.113.1. I noticed the bog down shortly after upgrading (a few days ago). Rebooting solves the issue temporarily. My Pi is a 4th gen with 4gb ram. My DB is around 800mb. When I run top in SSH for hassio, almost everything shows 0%.

I notice this to a far lesser degree as my HA server is running on a core-i7, but there is a trend for CPU use to increase with time since upgrading to 0.113.

If you already had a high CPU load this could have pushed you into the non-responsive region.

a9d20b475c7a6cd572381a946da71795b0e294d0_2_661x500

If you have spotcast installed, please make sure you have the latest version

If that doesn’t solve it, please post a py-spy recording

I do not.

How would I go about doing that on a HassOS install?

If you are on a PI and using the latest images you can use also install with

‘apk add cargo’
‘cargo install py-spy’

I’m running the NUC image and I am away from home for another 8 months, so don’t have physical access to import the keys via USB.

in my case python3 seems to be what triggers the CPU consumption and blocks HA

Hopefully someone else with the same issues (likely a specific integration) is able to send a py-spy and then we can fix it.

In the mean time you might try disabling integrations until the problem goes away to help narrow it down to a specific integration.

1 Like

hi, what command should i launch the next time my HA crashes? I am using supervised home assistant in Debian.
Un saludo y gracias

I thought I’d have a go here but py-spy is failing to compile on an RPi3 with latest hassio image. It leads to this very unhelpful (to me) issue with no resolution: https://github.com/XAMPPRocky/remove_dir_all/issues/20

Just to add, I am seeing the same issue. Spot cast not used. Upgraded from 0.111 to 0.113.2 yesterday morning and the baseline CPU usage on my tinkerboard s has increased from ~ 12% consistently to ~ 24% and slightly increasing ever since then. The Cpu usage itself is not an issue and doesn’t impact performance, but it has caused much higher temperatures on the passively cooled tinkerboard (usually 45 degrees, now up to 65 degrees). I haven’t been able to identify a particular component or feature that seems to be responsible, what can I do to troubleshoot or investigate?

Hi,

I got same problem of high CPU usage after upgrade to 0.113. version. A restart HA solve problem for a sort time then it increase from normal 15-16% to 30-32% in about 2-3hrs

Hassio_cpu_usage

There is no change in my Automation/Script after update.

Hope problem can be fixed in future update.

Thank you.

@jdbrookes see bdraco’s post regarding py-spy above.

My apologies for not being more involved in this thread. I am on a Pi4 with 4gb of RAM running Hass.io

I would restart the HA service, and the CPU usage would be start off lower, then rise. This week, I installed MariaDB for database storage and that seemed to level off CPU usage, not to say this is the fix all or anything.

I know there was a recent database conversion. A couple of things for you to try:

  • Rename your default database and see if the high CPU usage comes back
  • Start using MariaDB as your database

Again, not sure this solves the issue, but it did seem to work for me. Whatever was underlying could still be there. Would love to hear some feedback if you try.

I’m already using MariaDB, so this is not my issue.

Another voice adding to this - experiencing the same thing and when HA stalls, it chucks errors mostly relating to pychromecast (although there is other stuff lurking) in the logs.

I would try to install py-spy, but it won’t compile on my Pi4 due (apparently) to an older version of rustc which doesn’t support certain options and chucks out an error:

cfg(doctest) is experimental and subject to change

Unfortunately, rustup isn’t installed and attempts to manually upgrade it fail as (I suspect) there are no pre-compiled, updated binaries for the Pi4.

Happy to help in providing diagnostic information, but a little out of my depth trying to get this lot working! If someone could suggest a way to sort this, I’ll happily provide more information.

Seeing the same thing. I had hoped going from .113.2 to .113.3 would fix it since I do have Chromecasts. It does seem like it’s not increasing quite as fast but it still is increasing. I’ll try and get a py-spy tonight.

Here is my py-spy recording, hopefully it helps.

Thank you for the py-spy recording. Would you please post the full .svg file as the detail is lost when in the screenshot.