fix(romm): snapshot Redis hourly like the upstream image (#17562)

* fix(romm): snapshot Redis hourly like the upstream image

Redis' default save policy (3600 1 300 100 60 10000) rewrites the whole dump.rdb every 5 minutes on an idle RomM, because the RQ workers and scheduler change keys constantly. With the Switch TitleDB and PS2 serial caches the dump is ~50 MB, so an idle container writes ~14 GB/day. Upstream fixed this for the Docker image (rommapp/romm#3983, REDIS_SAVE_POLICY default "3600 1"), but that lives in docker/init_scripts/init, which the LXC install never runs. Apply the same policy on install and, for existing containers, on update unless a save policy is already set.

* Update ct/romm.sh

* Update install/romm-install.sh

---------

Co-authored-by: Michel Roegl-Brunner <73236783+michelroegl-brunner@users.noreply.github.com>
This commit is contained in:
Denislav Denev
2026-09-29 14:02:51 +02:00
committed by GitHub
co-authored by Michel Roegl-Brunner
parent d095b9020c
commit 8a314a12be
2 changed files with 8 additions and 0 deletions
+7
View File
@@ -56,6 +56,13 @@ function update_script() {
msg_ok "Migrated RQ services"
fi
if ! grep -q '^save ' /etc/redis/redis.conf; then
msg_info "Reducing Redis snapshot frequency"
echo 'save 3600 1' >>/etc/redis/redis.conf
$STD redis-cli CONFIG SET save "3600 1"
msg_ok "Reduced Redis snapshot frequency"
fi
if check_for_gh_release "romm" "rommapp/romm"; then
msg_info "Stopping Services"
systemctl stop romm-backend romm-worker romm-scan-worker romm-scheduler romm-watcher
+1
View File
@@ -167,6 +167,7 @@ echo "__version__ = \"$(cat ~/.romm)\"" >/opt/romm/backend/__version__.py
msg_info "Creating environment file"
sed -i 's/^supervised no/supervised systemd/' /etc/redis/redis.conf
echo 'save 3600 1' >>/etc/redis/redis.conf
systemctl restart redis-server
systemctl enable -q --now redis-server
AUTH_SECRET_KEY=$(openssl rand -hex 32)