Skip to content

Commit 5ce3124

Browse files
committed
fix(redis): configure Redis for production stability
Fix Redis MISCONF errors by disabling RDB snapshots and allowing writes even if persistence fails. Add production optimizations. - Disable RDB (--save "") - AOF is sufficient - Set stop-writes-on-bgsave-error no - Change policy to allkeys-lru (evict instead of fail) - Increase memory limits (4gb/5G) - Add TCP tuning and lazyfree optimizations - Upgrade to redis:7-alpine Fixes production worker errors from Redis write blocking.
1 parent dba69f0 commit 5ce3124

File tree

1 file changed

+20
-4
lines changed

1 file changed

+20
-4
lines changed

docker-compose.prod.yml

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,30 @@ services:
5858
# REDIS - Shared Cache & Pub/Sub
5959
# ===========================================================================
6060
redis:
61-
image: redis:alpine
61+
image: redis:7-alpine
6262
container_name: docsplus-redis
6363
restart: unless-stopped
64-
command: redis-server --appendonly yes --maxmemory 512mb --maxmemory-policy noeviction
64+
command: >
65+
redis-server
66+
--appendonly yes
67+
--appendfsync everysec
68+
--maxmemory 4gb
69+
--maxmemory-policy allkeys-lru
70+
--save ""
71+
--stop-writes-on-bgsave-error no
72+
--tcp-backlog 511
73+
--timeout 0
74+
--tcp-keepalive 300
75+
--maxclients 10000
76+
--lazyfree-lazy-eviction yes
77+
--lazyfree-lazy-expire yes
78+
--lazyfree-lazy-server-del yes
6579
volumes:
6680
- redis-data:/data
6781
networks:
6882
- docsplus-network
83+
sysctls:
84+
- net.core.somaxconn=511
6985
healthcheck:
7086
test: ["CMD", "redis-cli", "ping"]
7187
interval: 10s
@@ -74,9 +90,9 @@ services:
7490
deploy:
7591
resources:
7692
limits:
77-
memory: 768M
93+
memory: 5G
7894
reservations:
79-
memory: 256M
95+
memory: 1G
8096

8197
# ===========================================================================
8298
# REST API (Hocuspocus)

0 commit comments

Comments
 (0)