Move arr tracked-data cache to tmpfs, keep disk copy as persistent backup
Reads/writes now hit tmpfs (ARR_CACHE_DIR) instead of the array disk -- a full rebuild for all three arrs measures ~12s live, so there's no real cost to losing it on reboot. The existing on-disk file becomes a backup that arr_cache_write() keeps in sync on every write, and arr_cache_age_seconds() transparently restores it into tmpfs the moment it notices tmpfs is missing -- so a cache that was fresh before reboot reads as fresh after too, closing the cold-start gap without needing a dedicated restore step anywhere else.
This commit is contained in:
+2
-1
@@ -136,7 +136,8 @@
|
||||
LOG_DIR="/var/log/varaverk"
|
||||
VV_CACHE_DIR="/tmp/vv_cache"
|
||||
CONF_RAM_CACHE_DIR="/tmp/.cache/vv/d" # tmpfs — cleared every reboot, repopulated by conf_sync.sh
|
||||
export CONF_DIR LOG_DIR VV_CACHE_DIR CONF_RAM_CACHE_DIR
|
||||
ARR_CACHE_DIR="/tmp/arr_cache" # tmpfs — cleared every reboot, restored from DATA_DIR backup by arr_cache_age_seconds()
|
||||
export CONF_DIR LOG_DIR VV_CACHE_DIR CONF_RAM_CACHE_DIR ARR_CACHE_DIR
|
||||
|
||||
# ━━━ Cleanup ━━━
|
||||
unset _conf _host_confs_loaded _adapter LOAD_CONFIG_DIR
|
||||
Reference in New Issue
Block a user