Is there a way to see why home assistant is using so much CPU

I have a raspberry pi with a fan and recently the fan runs all the time, because the CPU is hot and that is because the load average on the on the PI is 6 with 6 home assistant python3 threads apparently just running all the time:

`top - 11:56:39 up 1 day, 5:25, 0 users, load average: 6.22, 6.17, 6.05
Threads: 67 total, 6 running, 61 sleeping, 0 stopped, 0 zombie
%Cpu0 : 99.3/0.7 100[|||||||||||||||||||||||||||] %Cpu1 : 100.0/0.0 100[|||||||||||||||||||||||||||]
%Cpu2 : 99.3/0.7 100[|||||||||||||||||||||||||||] %Cpu3 : 100.0/0.0 100[|||||||||||||||||||||||||||]
GiB Mem : 27.5/3.7 [ ]
GiB Swap: 0.0/1.2 [ ]

PID USER      PR  NI    VIRT    RES  %CPU  %MEM     TIME+ S COMMAND                                          

81390 root 20 0 1957.4m 575.7m 98.7 15.2 89:12.60 R python3 -m homeassistant --config /config
84138 root 20 0 1957.4m 575.7m 65.6 15.2 90:42.94 R python3 -m homeassistant --config /config
84137 root 20 0 1957.4m 575.7m 61.6 15.2 28:39.77 R python3 -m homeassistant --config /config
84612 root 20 0 1957.4m 575.7m 59.6 15.2 30:19.42 R python3 -m homeassistant --config /config
81480 root 20 0 1957.4m 575.7m 55.6 15.2 90:21.81 R python3 -m homeassistant --config /config
81482 root 20 0 1957.4m 575.7m 54.3 15.2 29:35.58 R python3 -m homeassistant --config /config
81359 root 20 0 1957.4m 575.7m 2.6 15.2 4:16.10 S python3 -m homeassistant --config /config
81373 root 20 0 1957.4m 575.7m 0.0 15.2 0:00.15 S python3 -m homeassistant --config /config
81380 root 20 0 1957.4m 575.7m 0.0 15.2 0:00.07 S python3 -m homeassistant --config /config
`
How can I find out what these threads are doing?

Have a look at the CPU Usage on each addon page (if you’re running HAOS). Go to Settings > Addons and check what’s being reported for each addon

If the results are inconclusive, install the System Monitor integration so at least you’ll be able to monitor the actual usage when it spikes.

Thank you. The problem is the ipef3 integration. Disabling that made the problem stop.

Knowing that lead me to 100% CPU usage (under certain conditions) with iperf3 integration · Issue #75775 · home-assistant/core · GitHub where this is a reported issue.

thank you

2 Likes