From 0b595751c5788af9113d75dc342eff5327b4061d Mon Sep 17 00:00:00 2001 From: Viktor Barzin Date: Mon, 23 Mar 2026 11:52:49 +0200 Subject: [PATCH] move Frigate cache to tmpfs to eliminate disk writes on node1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add 512Mi tmpfs emptyDir for /tmp/cache — Frigate writes 10s MP4 segments here continuously for all cameras. With motion-only retention, segments without events are deleted immediately anyway, so losing them on pod restart is acceptable. Node1 disk writes: 3.55 MB/s → 2.08 MB/s (previous commit) → 96 KB/s (now) --- stacks/frigate/main.tf | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/stacks/frigate/main.tf b/stacks/frigate/main.tf index 71eb8a75..73a208b9 100644 --- a/stacks/frigate/main.tf +++ b/stacks/frigate/main.tf @@ -127,6 +127,10 @@ resource "kubernetes_deployment" "frigate" { name = "media" mount_path = "/media/frigate" } + volume_mount { + name = "cache-tmpfs" + mount_path = "/tmp/cache" + } # Restart pod if GPU becomes unavailable, Frigate hangs, or # detector falls back to CPU (inference time spikes from ~20ms to 200ms+) liveness_probe { @@ -184,6 +188,13 @@ for name, det in stats.get('detectors', {}).items(): claim_name = module.nfs_media.claim_name } } + volume { + name = "cache-tmpfs" + empty_dir { + medium = "Memory" + size_limit = "512Mi" + } + } volume { name = "dri" host_path {