Home Assistant docker container very slow to start(Solved)

Hi,

Not sure if this is the correct place to post this, but wanted to share with the community in-case anyone else has the same issue.

I was having very slow home assistant start times (30 minute+) when starting/restarting the docker container. Restarting via the web interface performed much better.

Looking in the docker logs I could see (or not see) that home assistant hadn’t even started running, and it was hanging on the S6 supervisor functions. System resource usage was low, disk IO was minimal but other applications were performing as expected. I tried pruning docker and re-pulling the latest image and noticed that the download was fast, however the extraction was extremely slow/hanging.

After a bit of digging I found that disabling real-time anti-virus scanning on my docker host fixed the issue immediately. In my case I was using Sophos Anti-Virus for linux, and real-time anti-virus scanning can be disabled with:

 /opt/sophos-av/bin/savdctl disable

Starting the docker container & home assistant is now lightning fast. An annoyingly obvious fix in hindsight :man_facepalming:

Hopefully this helps someone else.

Best,
Ryan

I too noticed this recently. I haven’t timed it but 30 minutes is probably the ballpark. I don’t have antivirus running on my Synology so not sure what is causing the delay.

I did some digging on this and found that the hold-up is on the recorder as I get several of this message:

WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: recorder

I decided to set the purge_keep_days to 2 as I don’t really keep track of the logs anyway. It seems to have sped-up startup back to how it used to.