Strange increase in CPU usage

I have a power monitoring plug that is connected to a dell micro PC that runs my home assistant in a VM (virtualbox).

I’ve noticed on several occasions that the CPU usage increases and stays high, often after a reboot caused by an HA upgrade. This doesn’t happen every time, buts not super rare either.

So much so that I now have an automation that alerts me if the power draw on that plug goes over a certain level for a given period. If this happens, the only thing to fix it is to shutdown the VM to a powered off state, then restart it.

I also noticed it happening at other random times (not related to upgrades), for example, at 2.36am on 10th February:-

(The drop at the end of the trace is after I’ve powered down and restarted the VM).

Is this a known issue ?

Probably database maintenance.
With updates there might be requirements to make changes in the database and the newest update have a quite hefty one included. You should really let these run through. The time depends on the amount of data you log in your recorder and long term statistic.
At regular intervals, typically at night, there will be database purges also where old entries that have fallen for the time limit will be removed.

I did wonder that, but these CPU increases run for days if I don’t power down the VM.

1 Like

Well, your forced shutdown actually makes it worse, because then the updates needs to do a roll back first, which is to rewind the abruptly interrupted update and then it can try again.

I’ll leave it alone for longer this time and see if it settles.

1 Like

Not if you do an ACPI shutdown.

I do not know how a database maintenance/update deals with a ACPI shutdown.
It can do a roll back, it can pause the update and it can pause the shutdown to finish the update.
It depends on how the OS and application is programmed.