htop consistently shows process python3 homeassistant is consuming 100% of available CPU, a few hours after device boots.
While CPU is at 100%, hass response to the user is sluggish to the point of being unusable.
CPU consumption remains at 100% until device is restarted.
On restart, hass performs great again, and CPU consumption resets back to a few percent.
CPU gradually increases and then jumps back up to 100% again after a few hours.
hass is running on a pi-3 device as Core inside the standard Docker container. Installed using the default instructions. Installed with the April 2023 release.
I’m keen to keep using the pi for other things in tandem with hass, so need to avoid the HAOS approach.
Any tips on what might be causing the problem?
This chart illustrates the problem. Red is total CPU consumed by all processess. Blue is homeassistant process. Device is reset at 05:00.
As stated, you probably have a memory leak. I had this problem a while back, I think it was the NMAP tracker, but I can’t remember. As a safety measure, I created an automation to restart my raspberry pi if cpu usage ever went over 90% for thirty minutes and send me an alert that it was going to restart.
I also have alerts for if CPU usage stays over 60% for 30 minutes, and another if it stays over 80% for 30 minutes.
Yep, it was the Devolo integration. With a subtlety.
CPU consumption grows over time IF:
Devolo integration enabled by auto-discovery AND
Several Devolo devices found AND
at least one Devolo device is then unplugged.
The key bit is unplugging a discovered device. This leads to steady CPU consumption.
Disabling the unplugged devices may help a little. Over a 15 minute test, the CPU seemed to improve slightly although did not properly recover in that time.
Disabling the unplugged devices and then restarting hass worked fine. CPU consumption back to normal.
If so, will there be some additional hass code somewhere else, which integrates devolo_plc_api into hass? And could it be this hass code which is causing the leak?