I found a better tool to help me diagnose the issue: py-spy
ssh [email protected] -p 22222
login
docker exec -it homeassistant /bin/bash
apk add py-spy --update-cache --repository http://dl-3.alpinelinux.org/alpine/edge/testing/ --allow-untrusted
Then I can use top
to find the PID of the Python process. Then I can run py-spy
.
From that tool it seems like the Chromecast integration is very heavy. After I disabled it (and restarted HA), the loadavg is usually under 1, and the temperature is down to 55°C. Still not as low as before, but maybe it needs more time to cool down. I’ll keep investigating.
And from looking at many forum threads I also discovered the Profiler integration. That’s something I’m gonna try later.
Here’s a list of forum threads that I found, so far (in no particular order):
- Search results for 'py-spy' - Home Assistant Community
-
How to install py-spy? (2021-10-18 to 2022-02-12, installs using Alpine’s
apk
) -
Help with installing Py-Spy to identify process pushing the CPU to 100% 24/7 (2020-11-26, tries installing using
pip
) -
Python3 high CPU Usage (from 2020-01-03 until 10 days ago)
-
_worker
can be ignored as it’s idle time (2022-01-15)
-
- WTH: Isn’t Py-Spy integrated in Home-Assistant? (2020-09-17)
- Py-spy in Home Assistant running on RPi 3 with HassOS-based image (from 2020-06-03 until 2022-09-20)
-
Home Assistant - High Memory Usage (from 2020-03-23 until one month ago)
-
py-spy
command-line examples (2020-10-09)
-
- High processor usage of python3, drives processor to high temps (2020-05-13)
- High CPU usage after 0.113 (from 2020-07-28 to 2020-08-26)
-
Sharp permanent increases in CPU usage (2022-02-15)
- GitHub issue #66389: CPU usage is high after 2022.2.0 (still open as of now)
- HA CPU usage normal? (from 2021-06-15 to 2022-05-10)