HAOS on RPi5: (only the) frontend unusably slow

Hey everyone, I’ve been experiencing this issue ever since I started using HA, and I can’t understand where it’s coming from and how to debug it.

I have a Raspberry Pi 5 4 GB that I bought just for Home Assistant. I flashed the HAOS image onto an official microSD card (64 GB, Class 10, U3, A2), installed it, set up everything. And it all works very well: The automations run like a clockwork, everything executes smoothly and never breaks. Except, when I need to access the frontend (Lovelace). Then, it becomes unbearably slow.

For some files, mostly the static files, it can take multiple seconds to get a response. Look at this: it took almost half a minute to transfer a 100 KB file!

I started investigating and trying things out, but I can’t find the cause of it. What I’ve tried so far:

  1. Monitor the internals. Nothing looks off. I’m getting around 25% RAM usage, 2% CPU usage, sub-1 loads, 0% iowait, 0% swap usage, 40ºC temp. I almost find it too low to be true, but I checked it both from the UI and via Glances, so I tend to believe those numbers.
  2. Change the microSD card. I tried a different microSD card, the Amazon Basics 64 GB. No changes. The system itself runs smoothly, but the UI is unusable.
  3. Use locally. I usually access HAOS via a proxy. My HAOS install has an open port, which I proxy via Tailscale to a VPS, which in turn does the HTTP serving, HTTPS terminating, and access control. I tried accessing HAOS directly: Just using the local IP address. No changes.
  4. Start in safe mode. This also didn’t help; the UI is as slow as without it.
  5. Monitor the logs. I’ve been scrolling through a lot of things and I can’t find anything alarming.
  6. Update the system. I’m running the latest HA versions.
  7. Try a different power adapter. My usual power supply is the official Raspberry Pi one, recommended using with Raspberry Pi 5. I have tried a GAN charger brick instead, with various cables. No change.
  8. Run over a different network. I tried switching from Ethernet to Wi-Fi. No change.

Things I haven’t yet tried:

  • Get an SSD. I’ve read many opinions that microSD cards are rubbish, but I’ve never had any problems running any software on Pis and microSDs. It always worked for me, and I don’t want to introduce a USB cable bottleneck or buy an M.2 just for this; I’m sceptical that this will help.
  • Get a “real PC”. Yes, I know that NUCs exist, and no, they are not cheaper than Raspis, and as mentioned above, I’ve never had issues running all kinds of software on weaker Pis before. As with an SSD, I’m sceptical that this will solve the speeds. But I’m interested to hear your opinion on the matter!

I’m kinda lost here. Do you maybe have any ideas on how or what I should debug?

1 Like

Hey kytta,

Well written post and it is clear you troubleshooted thoroughly before posting.
Normally I would say it is likely an SD card issue, however you already tested that.
For good measure: can you boot up a VM on your laptop/desktop and restore one of the HA backups you have in there & then test the UI? If that works smoothly it has to be something on the PI.
Another thing you can try is to remove the tailscale connection if it is running locally on the PI and test again. It shouldn’t be the case but perhaps it may have some routing issues.

1 Like

What other devices do you have plugged into your raspi?