Closed Ming-A closed 2 years ago
managed to clean space by deleting the cache file, but is there a way to have the cache clean it self after some time so i dont have to manually delete it?
Disclaimer in case I get anything wrong - I am not an expert.
I have experienced cache filling when my camera is incorrectly configured and ffmpeg crashes as the recordings are being corrupted so don’t get flushed to the correct folder. I would troubleshoot your camera first. Perhaps start by disabling RTMP - especially if this is a H265 camera?
To do so, remove the rtmp role and inside the camera definition add:
rtmp:
enabled: False
The cache should clear itself regularly, it may not be relevant but the default config recommends a RAM disk for cache as defined by the following docker-compose volume:
- type: tmpfs # Optional: 1GB of memory, reduces SSD/SD Card wear
target: /tmp/cache
tmpfs:
size: 1000000000
Disclaimer in case I get anything wrong - I am not an expert.
I have experienced cache filling when my camera is incorrectly configured and ffmpeg crashes as the recordings are being corrupted so don’t get flushed to the correct folder. I would troubleshoot your camera first. Perhaps start by disabling RTMP - especially if this is a H265 camera?
To do so, remove the rtmp role and inside the camera definition add:
rtmp: enabled: False
The cache should clear itself regularly, it may not be relevant but the default config recommends a RAM disk for cache as defined by the following docker-compose volume:
- type: tmpfs # Optional: 1GB of memory, reduces SSD/SD Card wear target: /tmp/cache tmpfs: size: 1000000000
currently need RTMP since I'm using it with home assistant, and its an h264 camera
Disclaimer in case I get anything wrong - I am not an expert. I have experienced cache filling when my camera is incorrectly configured and ffmpeg crashes as the recordings are being corrupted so don’t get flushed to the correct folder. I would troubleshoot your camera first. Perhaps start by disabling RTMP - especially if this is a H265 camera? To do so, remove the rtmp role and inside the camera definition add:
rtmp: enabled: False
The cache should clear itself regularly, it may not be relevant but the default config recommends a RAM disk for cache as defined by the following docker-compose volume:
- type: tmpfs # Optional: 1GB of memory, reduces SSD/SD Card wear target: /tmp/cache tmpfs: size: 1000000000
currently need RTMP since I'm using it with home assistant, and its an h264 camera
I’m not suggesting it needs to be a permanent change, I’m only suggesting to rule it out
Hm I guess I can give it a try, how do I compare the difference though to see if it has affected it? And usually how long?
Previously I wouldn't say I had any issues with storage for frigate, just only recently when I recreated the container to work with traefik for reverse proxy, might be missing something maybe in the docker-compose, I also seen in the issues GitHub that some of the cache problem is related to day light saving? Not sure if it's related though to mine
Do you see lots of files in /tmp/cache
inside the container? Maybe the recording maintenance job failed and you have a bunch of lingering files in there. Try clearing them out. If you map the /tmp/cache location to somewhere on the host, the container should not grow in size since every location that it writes to will be mapped to volumes.
You can also try deleting the container to let it recreate a fresh one.
Do you see lots of files in
/tmp/cache
inside the container? Maybe the recording maintenance job failed and you have a bunch of lingering files in there. Try clearing them out. If you map the /tmp/cache location to somewhere on the host, the container should not grow in size since every location that it writes to will be mapped to volumes.You can also try deleting the container to let it recreate a fresh one.
from the screenshot above there were a lot of files in /tmp/cache. I have cleared it and gained a lot of space back. Currently been 12+ hours and it doesn't seem to be using much yet. I didn't map a /tmp/cache location, if it increases a lot again then I might map it to a volume and see how that goes.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I'm facing the same issue. My Frigate container grows by 250 MB daily. The media library is on an external HDD, /tmp/cache isn't large, and frigate.db is 53 MB, growing normally by 2-3 MB per day. I have two cameras on a busy street. What could be causing this large container size increase?
Describe the problem you are having
For some reason my frigate container is using about 22gb which makes my disk full, I have mounted clips and recording to both my samba share.
Version
0.9.4-26AE608
Frigate config file
Relevant log output
FFprobe output from your camera
Frigate stats
No response
Operating system
Other
Install method
Docker Compose
Coral version
CPU (no coral)
Network connection
Wired
Camera make and model
HIKVISION DS-2CD1023G0E-I(L)
Any other information that may be helpful
Docker-Compose container: