Home Assistant is very slow and get stuck once a couple of days

Getting rid of the Pi is where you’ll end up.

As we speak I am getting mentally ready for it :sweat_smile:

3 Likes

@ski522 @Tommmii
I will first try that sensor inclusion/exclusion in the mean time and see what comes of it.

Hi All,

I have exactly the same issue. My setup is Raspberry PI3B+ and I run the HomeAssistant within the Docker, as well as NodeRed.

At some point one of the HomeAssistant processes start consuming 100% of the CPU and web interface become unresponsive.

I thought that this might be an SDCard issue, but nothing has been improved after I have replaced it with the new one.

I haven’t noticed any of those issues till version 0.9.X

Basically… The SD card is causing high wait times. This is especially true with recorder db.

I bet you if you just disable recorder your performance will dramatically improve.

Try it :slight_smile:

1 Like

I have just double checked and it seems my DB is 5GB.

A quick question, what will happen is my DB is temporary unavailable, would it break HA?

I have an idea to use a cloud DB, so I can potentially offload all IOPs to the cloud and keep a lot of data, however I am not sure if HA will fail if DB will be unavailable due to the Internet issue or something.

Any ideas?


Ok, I moved my DB to Azure MSSQL.

Seems like temporary connectivity outages don’t crash HA, but just throw exceptions in logs.

IOPS have decreased significantly as well as CPU load.

Going to monitor it for a few days.

After moving DB to Azure MSSQL - I can say that situation got significantly improved.
It no longer hangs or stick with the high CPU usage.
History get loaded nice and fast.
Tested “Internet Outage” that break connectivity to MSSQL DB - it doesn’t crash HA, but only generate some errors.

Eh, few days of a smooth run and now it’s back.


Does anyone has an idea what may cause this behavior?


Updated:

I have migrated from Raspberry PI to full x64 PC and still got this problem.
Seems like it has nothing to do with DB.
I got a feeling that it may be related to the Azure Event Grid integration. Testing now with it being disabled.

1 Like

Did you ever figure this out?

I’m having a similar issue after moving my instance from a docker install on a full Ubuntu 8 core PC to a hassio VM on an optiplex 4th gen i7.

Checking the config alone takes 3 minutes or longer and restarting takes no less than 10 minutes. It doesn’t even restart right away after hitting the button. I can usually still use HA for a good 5 minutes until it finally says it’s reconnecting, where it will take yet another 5 minutes to get up and running again. I even moved my database to mariadb to see if that would help but it made no difference at all.

Most, if not all cases above were caused by huge DB on slow SD card.

When you write …

… what does that mean ?

Means I have HA running on a virtual machine in windows using an i7 processor so the SD card issue doesn’t really apply and, since i’m not running it on a rpi, HA should not be as slow as it is for me. I have also deleted the database file since I switched to mariadb but I saw no improvement.

Hi Jeremy, Did you end up with a solution I am running a similar set up and the system has been running slow for a few weeks now. It has access for 4 cores and 6gb of ram and still takes ages to reset ect. Sometimes the UI is fast but sometimes it takes forever to respond. Thinking of restarting with a new VM and uploading the hassio snapshot.

Unfortunately I’m still struggling with extremely slow config checks and reboots. I even did what you mentioned by starting a new HA instance but this time on a Ubuntu Desktop VM using docker instead of HassOS. This is the same way I had originally installed HA, minus the VM. With everything still stock, it was obviously super fast so that gave me some hope, but as soon as the snapshot restored it was back to being super slow again.

I even started commenting out one component at a time in my config to see if I could narrow it down but that didn’t reveal anything to me, so I commented out just about everything from my config except for the basic stuff and that also didn’t seem to help. The next thing I’m considering is start completely from scratch, installing only one component at a time. However it took me almost two years to get HA the way I want it so this will be extremely time consuming. For now I’m just dealing with it since I do a config check and reboot maybe once or twice a day now and that’s really the only time it bothers me. Still, I know how frustrating it can be so hopefully we get this figured out soon. Do you use HACS at all?

Do you have many Add-ons running ? Try stopping them all then if that shows improvement then start them in turn and try and find if any are causing your issue. If you find an add-on causing a problem, in most cases, you can copy the config, remove the add-on then add it back and copy the old config over.

After several dead SD-cards and frozen session, i decided to buy a NUC.
My best move of 2019.

1 Like

I just tried your suggestion. Disabled all addons then checked config and it still takes forever to complete. I wonder if it’s ones of my HACS components causing the issue. I wish there was an easy way to stop those. I don’t want to have to uninstall all of them…

I’ve never installed HA on a Raspberry Pi before for that reason. Always on one of my Windows or Linux servers.

If you go into the raw lovelace config and make a backup copy first you can remove all of the HACS components there before refreshing your browser. You will get a lot of errors and red boxes on your cards but that is to be expected.

Once you are finished you can copy your backup config back to get it all back to normal.

Awesome! I assume you mean just the resources?

Correct - but copy all that config first and save it elsewhere before you start deleting lines :wink:

Aw sorry, wrong reply :wink:

Unfortunately that didn’t work either :slightly_frowning_face:

Is there a way to disable the other HACS integrations that are not used in lovelace cards without uninstalling?