From fa46709aaed8f3e7f0e33a63585e62fbbae45eae Mon Sep 17 00:00:00 2001 From: Josh Poole Date: Mon, 24 Aug 2026 08:53:23 +0100 Subject: [PATCH] Mount /run as tmpfs to stop ~7 GB/day of SD-card writes The container declares tmpfs for /var/log only, so /run/readsb, /run/tar1090, /run/graphs1090 and (with REDUCE_IO) /run/collectd all sit on the container overlay - which on a node is a consumer SD card. On a normal bare-metal tar1090 install /run is already tmpfs and none of this ever touches storage. readsb rewrites a 67-byte aircraft.json at 1 Hz regardless of whether any aircraft exist. Measured across four nodes it costs a flat 3.34-3.36 GB/day to produce ~8 KB/min of real JSON: roughly 300x write amplification, since each tiny file still dirties a full 4 KB ext4 block plus a journal entry. collectd adds another 2.8-6.6 GB/day rewriting 48 RRD files every 60s. GRAPHS1090_REDUCE_IO runs the RRD set from /run/collectd and writes it back as one gzipped tarball. It is only effective because /run is now tmpfs - enabled on its own it would move the writes from one spot on the card to another. exec is required on the mount: s6-overlay execs its service scripts from /run/service and /run/s6-rc. Nothing meaningful is masked - the image bakes only /run/adduser and /run/lock into /run, both empty directories. The ADS-B pathway is unchanged. readsb still writes aircraft.json at 1 Hz and proxy/server.js still reads that file first on every request, so a local receiver behaves exactly as before; only the backing store differs. Verified on two nodes over a 46-hour soak: block-layer writes fell from 6.32 to 0.79 GB/day and 4.39 to 0.71 GB/day, collectd to zero, readsb to 0.10 GB/day (the residual is /var/globe_history, which stays on flash by design). /run held steady at 36-40M of 64M, growing ~1 MB over 46 hours. The RRD set varies by node (23M, 30M), so 64M has headroom where 32M would not. Co-Authored-By: Claude Opus 5 --- docker-compose.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index 234fa20c3..a77494860 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -29,5 +29,14 @@ services: - RECEIVER_LON=${RECEIVER_LON:-0} - ADSBLOL_RADIUS=${ADSBLOL_RADIUS:-40} - PROXY_PORT=3005 + # SD-card endurance: run the graphs1090 RRD set from the /run tmpfs below + # and write it back as a single gzipped tarball, instead of 48 scattered + # in-place RRD updates every 60s. Only effective because /run is tmpfs. + - GRAPHS1090_REDUCE_IO=true tmpfs: + # /run holds volatile runtime state (readsb JSON at 1 Hz, tar1090 chunks, + # graphs1090 PNGs, s6 service dirs) and is tmpfs on any normal install. + # On the container overlay it cost ~7 GB/day of SD-card writes for ~8 KB/min + # of real data. exec is required: s6-overlay execs its service scripts here. + - /run:exec,size=64M - /var/log:size=32M