Go2rtc using 99% cpu in HA

After noticing a slight bump in power consumption from my homelab and cpu usage, I was able to narrow it down to home assistant constantly running at 99-100% cpu usage. Restarting HA will “fix it”. I cannot correlate the spike in CPU usage to any action on my side.

This started happening after I upgraded to 2024.11. Apparently go2rtc seems to be the culprit which maybe has to do with the new webrtc features on this version?

Anyone having the same experience?

2 Likes

I have go2rtc in frigate. None in hass.

I run frigate separately from HA on a docker container. But I think maybe this is being caused by the frigate card on the dashboard.

1 Like

I was having a similar issue every time I viewed the cameras through the iOS app. CPU would max out and not go down until HA was restarted.

I run UniFi cameras. What seems to have fixed it for me is changing my camera settings from “Enhanced” encoding (H.265) to “Standard” encoding (H.264).

It’s better to create issue in the go2rtc github project.
It’s important to understand which camera created the problem.
It’s probably some kind of RTSP stream. But there may be other options.

1 Like

I’m having the same issue with go2rtc. Pegging my CPU. It incrementally grows over time, in steps, and then pegs things out. I’m using Unifi Protect cameras with a Picture Glance card, but restarting Unifi Protect doesn’t solve the CPU problem. Only a reboot of Home Assistant. However, a reboot of Home Assistant is only VERY temporary as within 12 hours or less it spikes again. Using Glances it shows that go2rtc is the main culprite with 200%+ CPU usage. Any ideas on a resolution here? Posted the same thing to a thread on Reddit about a user having the same issue.

1 Like

Same issue here.
I deactivaded the UniFi integration but the CPU ist still under load.

If it helps you at all, the solution on my end was to change the Picture Glance card to use “Auto” instead of “Live”. For some reason the “Live” setting was causing it to open multiple streams and never closing them, eventually overloading the go2rtc plugin. Multiple HA updates have also come through, which contributed to things getting better on my end.

1 Like

Same problem , still not fixed . Any better option .?

Same problem, still not fixed. I have two Foscam cam. This is a really dangerous issue, because the CPU temperature grow to 85° !

same here maxs out my AMD synology.

I can confirm this was the fix.

with recording mode set to enhanced mode in protect app I had the problem setting to to standard fixed the issue.

With enhanced the second I opened a camera /bin/go2rtc -c /tmp/go2rtc_2j6kvymy.yaml was never shut down when close the camera in the webbrowse of HA was off. With standard recording mode this now shuts down.

also seeing a big spike in CPU from rstp feeds from my EUFY cameras…going back to WEBRTC removes most of the CPU drain

I had the same observations. In my case the settings in the picture glance card was set as live. When I switched all my camera views to auto, the CPU cooled down :slight_smile: