Bad performance of my Home Assistant

During the last days / weeks I am experiencing a really bad performance in my Home Assistant installation:

  • actors are reacting super late - takes 25 seconds instead of half a second as before
  • the user interface is loading super slow - takes 20 seconds instead of one second as before (using web browser or Android companion app, from local network / wifi or from internet, everywhere the same)

Is it normal that the raspberry pi 4 CPU is running on more than 35/40% in the average?

Do you have any idea how to analyze this issue or optimize?

Many thanks in advance.

Is there anyone who could help? Cheers

I had similar with my RasPi 4 HA OS installation. I also have LocalTuya, Rhasspy voice assistant and node-RED add-ons.

TL;DR - I believe that with these add-ons, network messages were not always being processed before the next one arrived and resulting in errors snowballing till the system couldn’t respond at all.


Normally HA would run at around 3% CPU use - but would sometimes climb to 26% at which point it wouldn’t even react to the HA [restart] button. The HA core log was full, with some errors reported over ten thousand times.

Looking at the early part of the log, it looked like devices were dropping of my LAN, and as the errors got more frequent they seemed to result in other errors as well … until it hit critical mass. To fix I had to reboot (often by pulling the power) usually 3 times, which I guess was to clear the backlog of network errors.

Some of the errors referred to Ingress, and I remembered forum comments about SD cards failing because of all the HA database updates. Swapping to a SSD helped some, but didn’t fix the problem.

Since most of the devices were on wi-fi I guessed that I had gone over my Access Point’s limit and some devices were being dropped from the WLAN - so I purchased a Draytek WAP. This provided a lot more debugging info, but didn’t fix the problem, and since I couldn’t justify cost of DrayTek’s better unit I swapped to a ASUS router to use as AP only. While less frequent, the problem has remained.

I have finally upgraded to a second-hand OptiPlex 7050 PC with i5 CPU, and haven’t had the problem show for … okay, it’s only been 5 days now, so hardly conclusive. I am still getting occasional device not found errors despite them still being on the network.

I suspect the problem is that my add-ons are all using the network; and that as i added more devices and HA add-ons the RasPi’s network handling has become the bottleneck. I don’t know if the underlying problem is still the physical Wi-fi (increased latency due to interference and neighbours networks), that there are too many devices (and so messages) on the network (highly unlikely), or that the comms routines of HA, LocalTuya, node-RED and Rhasspy (MQTT messages) are not playing nicely together. Unfortunately I have become dependant on these add-ons.

Is it possible that you are running out of RAM and the OS is having to swap it out from a slower medium like an SD card? This is just a hunch on my part. How much RAM do you have?

Do you have any new automation or template sensor or add-on or integration that you have started around the same time you started noticing those issues?

Are you running latest versions?