Viewing events is becoming slower #4350
Replies: 6 comments 17 replies
-
How many cameras and roughly how many events do you have per day? What is your event retention like? Is your RPi running on an SD card or USB SSD? |
Beta Was this translation helpful? Give feedback.
-
Can you open the dev tools and see which network requests are slow? |
Beta Was this translation helpful? Give feedback.
-
I had a similar performance issue with 6 cameras and around 5 days of data. Frigate went so slow that even listing recordings worked only sometimes, mostly it was just left spinning. I/O usage on the host (Docker on LXC on PVE) went haywire. I can't totally rule out HDD issues as I'm using a few years old 1TB USB HDD for videos, but after I deleted all clips, recordings and database, it started running smoothly again. I did have to remove clips (.png and .jpgs) in two sets because just trying to rm -rf * said something about too long command (too many files?) so I thought maybe that large amount of files could be a reason for IO issues? I may have a lot more clips from last few days as I was testing zones which may have triggered the issue, but otherwise I've run this setup for weeks without hiccup. |
Beta Was this translation helpful? Give feedback.
-
I was checking my NAS share whilst troubleshooting another issue and it was very interesting to see how every single recording loaded instantly and allowed me to seek instantly (Frigate was still writing current recordings to it). I haven't accessed the files via the share for many, many months now. I do however understand that the methods are vastly different between loading an event or recording in Frigate and loading the files directly, as are the clip lengths. Frigate has to do a lot of clever patching and timestamp work to process the files which are faaaaaar behind my knowledge :D. I have just one 1TB drive which is reported as healthy, I'll do a cleanup of it and start fresh to see if it helps. Edit 7th March 2023, I didn't clean the drive up but left it as is, however over the last week or so it has become super fast reviewing events in Frigate again, but no changes have been made by me. It makes no sense at all! The Pi has not updated or rebooted, the NAS certainly hasn't updated as it's been EOL for ages. Still running BETA 8 0.12.0-27A31E7. Everything is running the same on the Frigate. I think one Unify AP updated that is all I can think of, that is in a different VLAN however and everything to do with the Frigate is wired. I am still getting "Unable to keep up with recording segments in cache" errors daily but every clip from either camera is now almost instant loading like it used to be. I just don't get it at all. |
Beta Was this translation helpful? Give feedback.
-
Right, so a bit of an update on this thread. I have changed away from the Pi 4 to a new 4x+ more powerful Intel based PC with 8GB of RAM. I have moved to onboard SATA EXT4 formatted HDD (NAS is OFF) and still, on my h264 1440p camera I am having to wait over 30 seconds for each event to load. On my H265 1080p camera it loads events in around 5 seconds. Database is on local SSD, only recordings are on the new HDD. Again the HDD used should be plenty fast enough and is designed apparently for "20+ CCTV cameras". Looking at the network tab, all I see is it waiting over 30 seconds for seg-2-v1.ts to load. |
Beta Was this translation helpful? Give feedback.
-
I experienced the same problem, but it was self-inflicted. Using an Ubuntu I5, 12 gen, with Frigate in a docker-compose container on its own 4TB NVMe drive, 13 cameras, mostly 4K, two USB corals. I had commented out port 8555 in my docker container config as an experiment, and didn't seem to suffer any ill-effects, so left it commented and forgot about it. But as my stored files grew, I experienced a slowdown only on playing stored files, not noticeable on page loading, or other operations. Restoring 8555 seems to have fixed the problem, though of course I also restarted the container in the process. FWIW. |
Beta Was this translation helpful? Give feedback.
-
Hi all,
When I first used Frigate v11 (currently I am on 0.11.1-2EADA21) I was amazed by the improvements in the event loading times, in the initial loading and especially the seek loading - all of the slow painful loading issues I had with Frigate before were suddenly resolved.
Sadly it seems over the last few weeks it's been getting quite a bit slower both for the initial loading and seeking. Even for events that just happened a few seconds ago which perhaps might even be sitting in the 1GB TMPFS RAM cache?
I have restarted my Raspberry Pi, and Frigate many times. I've restarted the NAS it records to and gave that a check over - it's only used for Frigate on a network that isn't used for anything else much at all - no high bandwidth activities going on. No changes have been made on the setup apart from just the usual system package and OS updates. CPU usage is around 35% average.
I only mount /media/frigate/recordings on the NAS, everything else is local on the SSD (lots of free space). I'll run a TRIM now on the SSD and anything else I can think of on the hardware itself and I will report back if I have any luck.
Could it perhaps be the database? Is there anything I can do to perhaps perform a maintenance task?
Many thanks
Beta Was this translation helpful? Give feedback.
All reactions