How to find which integration is causing high CPU usage?

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):

6 Likes