Home Assistant Performance Issues

I am not asking for the performance on my iPhone 11 Pro with companion app (latest version), even there it is really bad performance especially when you try to edit the dashboard here.

I am having problems with HA performance in general. My HA runs on an Intel NUC with upgraded SSD to 2TB and Ram updated to 32GB (I know way to much, but I plan in advance, later I want to add several more cameras).

SO I have 2 cameras connected with Frigate that is running as add-on on the same machine with coral USB Stick.

So my CPU usage is on 32% usually with some spike here and there

Memory is just used with 22% in general, not sure why system used swap and now erased it.

So what Is the bad performance you ask maybe. I see it when browsing the dashboard, camera previews are loading slow. Switch to a subview to show 1 camera preview and 2 snapshots takes several seconds to load. Also switch from camera subview to main view take time.

Here you can see a screen recording

I also have problem with camera views stuttering, on Reolik app (Camera producer) it is fluid, on frigate is is stuttering, doorbell (wifi) more then garden (Lan), but not on app.

I can not see why browsing dashboard is that slow, no matter If on my iPhone 11 Pro, iPad Pro (2020), MacBook M1 Max. tried Safari and Chrome with no difference.

There is also no difference if I am at home or accessing over internet, my upload speed at home is 40 Mbit so should be fast enough.

Some ideas or experiences with HA performance and how to make it faster?

You have a Celeron N CPU, which is very low end. I wouldn’t expect great performance, especially with CPU intensive applications like Frigate. Compared to a mid-range popular CPU (Intel 2600K) that came out 14-15 years ago it is still worse.

Even if the cpu usage is just around 30%? I would expect it to be bad if the usage is very high.

And frigate uses also the Coral USB TPU

Check camera’s I-frame setting, (if you have it in camera’s settings). Most camera streams are made up of I-frames and P-frames. I-frames are full images, while P-frames are sent between two I-frames and contain only changes. That’s for storage space (and bandwidth) saving.
So, whenever you request camera to be shown addon waits for first I-frame. Generally, this is set anywhere from 2s up to 5, or even 10. Set it as low as possible. But note that with lowering this camera will also consume more storage space when recording.

Try disabling the Frigate stuff, see if you still get bad performance.

that’s not the end-all-be-all of CPU usage. You can still configure frigate poorly which will lead to unnecessarily high CPU usage. Posting a screenshot of the frigate system page will help to see if that is the cause

Here frigate system status page

so a couple issues, biggest one is that garden zoom is running detect at 20 fps which is too high. The detect fps does not need to match the cameras fps, 5 is the recommended default

What are the other problems you see?

I change detection to 5fps, had it high for detection animals better. But cpu usage in overview just goes down around 1%

it will be more during times of high activity where detection would have been run more often.

go2rtc is using a decent amount. If you are restreaming both main and sub stream then perhaps only restream one and have the other connect directly to the camera.

indoor also has higher cpu usage, not sure if the detect resolution is just higher or why that is without seeing the config

For go2rtc I added this as config

    format: text
    exec: trace
      - rtsp://admin:[email protected]:554/h264Preview_01_main
      - rtsp://admin:[email protected]:554/h264Preview_01_main
      - rtsp://admin:[email protected]:554/h264Preview_02_main
      - rtsp://skycryer:[email protected]/stream1

This are the main streams, so I think it uses only the high quality streams for the video on dashboard. I use

type: picture-entity

and on a subview per camera

type: custom:frigate-card

so I can easy open last recorded clips.

But performance is not as good for both and it also takes often some time to switch to high quality stream.

And sometimes I see an error on picture-entity that stream could not be load, until I reload the site.