I have been running HA in Docker (see specs below) for almost three years without any performance issues, but on October 10 I started getting issues with high CPU load from the HA Docker container.
Normally CPU usage is between 5%-10%
, but suddenly CPU usages increases to 100%
(and above) and the CPU temperature rises from 50 C to 95 C and stays like that until container is restarted. Then CPU usages goes down to 5%.
This issue repeats every day, at none deterministic time pattern, it can be after 5 hours of restart, sometimes more and less.
I can’t see that I did install or update anything around October 10, but I have tried to disable few Integrations and custom sensors, such as Speedtest, MQTT, Arlo (HACS), ping, and others. But I still face the issue.
I have used the Profiler integration and py-spy
to get more insight into CPU load, but I have not succeeded in identifying what is actually causing the increase of CPU load. Maybe @bdraco could provide some guidance?
Files created with Profiler integration (you might need to download svg files locally for best view):
Files created with py-spy:
-
cpu-profile-120_100.svg
(py-spy record -o cpu-profile-120_100.svg --pid 60 --duration 120 --rate 100
) -
cpu-profile-300_200.svg
(py-spy record -o cpu-profile-300_200.svg --pid 60 --duration 300 --rate 200
)
Specs:
- Docker image:
homeassistant/intel-nuc-homeassistant:2022.10.5
- NUC spec: core i7, 16 GB RAM, 250 GB SSD
- OS: Ubuntu 22.04.1 LTS (GNU/Linux 5.15.0-52-generic x86_64)
- Docker:
v20.10.17
- Docker Compose:
v2.5.0