diff --git a/frigate/app.py b/frigate/app.py index 0ad72630d..fdd1d5242 100644 --- a/frigate/app.py +++ b/frigate/app.py @@ -207,7 +207,11 @@ class FrigateApp: # NOTE: all db accessing processes need to be created before the db can be bound to the main process self.db = SqliteQueueDatabase( self.config.database.path, - pragmas={"auto_vacuum": "FULL"}, # Does not defragment database + pragmas={ + "auto_vacuum": "FULL", # Does not defragment database + "cache_size": -512 * 1000, # 512MB of cache + }, + timeout=60, ) models = [Event, Recordings, Timeline] self.db.bind(models) diff --git a/frigate/record/record.py b/frigate/record/record.py index deac65f1a..3870a1b44 100644 --- a/frigate/record/record.py +++ b/frigate/record/record.py @@ -39,7 +39,11 @@ def manage_recordings( db = SqliteQueueDatabase( config.database.path, - pragmas={"auto_vacuum": "FULL"}, # Does not defragment database + pragmas={ + "auto_vacuum": "FULL", # Does not defragment database + "cache_size": -512 * 1000, # 512MB of cache + }, + timeout=60, ) models = [Event, Recordings, Timeline] db.bind(models)