question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Suggestion on mounting /cache on tmpfs

See original GitHub issue

I would recommend adding a bit in the Readme to mount the cache folder on to tmpfs or another ram based filesystem if possible to reduce wear on SSD’s and SD cards.

With 3 cameras keeping 10s cache each I only need about 50MB of cache, but to be safe I’ve gone with 100MB by adding this to my /etc/fstab and mapping it in my docker-compose.yml file. I know that fstab isn’t guaranteed to stay in ram compared to ramfs but ramfs can’t be limited in size which could cause other issues.

none /mnt/frigate-cache tmpfs nodev,nosuid,noexec,nodiratime,size=100M 0 0

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:3
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
danobotcommented, Oct 19, 2020

Yes I was going to suggest the same. Here is my Docker Compose (feel free to paste into docs)

  frigate:
    container_name: frigate
    restart: unless-stopped
    privileged: true
    shm_size: '1g' # should work for 5-7 cameras
    image: blakeblackshear/frigate:stable
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - <dir>:/config
      - <dir>:/clips
      - type: tmpfs
        target: /cache
        tmpfs:
          size: 100000000  # 1GB
    ports:
      - "5000"
0reactions
mattheyscommented, Oct 31, 2020

Looks like this had been added to the readme now so closing.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Is it a good idea to put ~/.cache in a tmpfs?
Sounds like you do have a problem. Yeah, so if the cache includes the tracker database, when you "clean" it you're just going...
Read more >
Mount a folder into the RAM with TMPFS - WP Rocket
To take advantage of good performance if you are using a HDD a good solution is to mount the cache folder directly in...
Read more >
Mount Cache Folders To Memory - RhodeCode Documentation
To increase the performance of folders containing cache data, you can mount them to memory. The following folders specified in the rhodecode.ini file...
Read more >
Storing Files/Directories In Memory With tmpfs - HowtoForge
This article shows how you can store files and directories in memory instead of on the hard drive with the help of tmpfs...
Read more >
tmpfs - Raspberry Pi Forums
Many Linux distros have /tmp mounted as tmpfs by default. There are also several other tmpfs filesystems, try the command "df" to see...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found