Recordings View slow to load
See original GitHub issueI’m running Frigate with 4 cameras with 24/7 recording as well as having clips.
90 day recordings 14 day event retention
~655400 database entries for each camera found by using the following SQL
SELECT count(*), camera FROM recordings GROUP BY camera
I was able to improve the initial performance from camera recordings HTTP endpoint by adding a SQL index.
3 secs -> 895ms in my case.
CREATE INDEX "recordings_camera_start_time_asc" ON "recordings" (
"camera",
"start_time" ASC
)
However, this still takes 30 seconds on the /api/[camera]/recordings
endpoint.
I believe the issue is the usage of the strptime and lesser so the usage of strftime. https://github.com/blakeblackshear/frigate/blob/bb68a2405b32bb821c69dbe2d9bd256083c99bc1/frigate/http.py#L459-L487
I’ve not looked into it further as I was just made aware of this today by my partner when they were trying to look the recordings. I’ll be looking into it later as I’ve told them 30 seconds is expected right now.
My initial thoughts are to use arithmetic to calculate the diff instead or to implement some kind of pagination.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:5 (2 by maintainers)
Top GitHub Comments
It’s already on my list of things to improve for the next release.
That endpoint is known to be slow. There is room for improvement, but I haven’t had time to look into it yet.