I’ve disabled almost all integrations, and still seeing a solid ~65% cpu usage. (very stable - CPU usage stays at that level)
I have installed py-spy, but can’t find the PID for home assistant. top shows nothing with “homeassistant” or python or any other obvious process.
I note that for both top and htop, all the visible processes are ~0% CPU usage, yet I can see all four cores are running about 65% each. i.e I can’t see any processes actually using any CPU…yet the CPU is very busy
It appears as if whatever process is using all the CPU is hidden from me?
pgrep -u homeassistant shows unknown user.
I’m pretty lost here…I cant py-spy a process if I can’t see that process?
Update: I couldn’t figure out how to see the processes directly from the terminal (I guess it’s running ina docker that is hidden from me, and I don’t know how to access).
But I installed Glances, and found it is the hassio_dns process that is using 162% cpu.
I checked my DNS entry, it was correct (8.8.8.8). So I changed it to point at my local DNS server, (that all my DHCP clients use), and that still had the same issue. I switched again to 1.1.1.1, same problem.
I note the dns logs have many lines like:
[ERROR] plugin/errors: 2 . NS: dial tcp 1.1.1.1:853: connect: connection refused
Anyhow, this is no longer a py-spy issue, so I’ll refrain from commenting further in this thread, and go try and figure out this DNS issue. Just leaving this info here in case it helps anyone else track down their CPU usage issues.
This thread looks promising regarding High CPU usage from Hassio DNS
I tried building above mentioned py-spy PR for python3.12 myself (forked dev312 branch on GitHub, and build with GitHub Actions: simplify workflow push · TimSoethout/py-spy@dcdec48 · GitHub, see wheel.zip download at the bottom.)
I used the py_spy-0.3.14-py2.py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64 build for my Odroid C2.
This results in error when run in my homeassistant docker on hassio:
$ ./py-spy top --pid 67
thread 'Error: <unnamed>' panicked at 'Failed to get process executable name. Check that the process is running.called `Result::unwrap_err()` on an `Ok` value: ()
', Reason: src/sampler.rs:59No such file or directory: (os error 492
)note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Reason: No such file or directory (os error 2)
Any pointers?
(I’m debugging this to find out a memory leak that reboots my whole device every ~3h when memory get to ~90%.)