From 8a314a12becc8c07b81e5ded3c6210e0cb2f57a1 Mon Sep 17 00:00:00 2001 From: Denislav Denev <72409354+DenislavDenev@users.noreply.github.com> Date: Tue, 29 Sep 2026 15:02:51 +0300 Subject: [PATCH] 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> --- ct/romm.sh | 7 +++++++ install/romm-install.sh | 1 + 2 files changed, 8 insertions(+) diff --git a/ct/romm.sh b/ct/romm.sh index be186e2ac..332e3e1fa 100644 --- a/ct/romm.sh +++ b/ct/romm.sh @@ -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 diff --git a/install/romm-install.sh b/install/romm-install.sh index 30114e8b7..15c3d8f76 100644 --- a/install/romm-install.sh +++ b/install/romm-install.sh @@ -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)