Skip to main content
FINOPS WORKFLOWGRAPH LAB // DIFY 9-CONTAINER STACK TELEMETRY DOCKER COMPOSE OVERRIDE | PGVECTOR HNSW + CELERY | BASELINE 2026-10-13
DifyStackRAM
DifyStackRAM Affiliate Notice: Outbound /go/ links marked rel="sponsored" may earn a partner commission at zero added cost (Affiliate Policy).
Container & RAM Tuning

Bounding Dify Redis Memory With maxmemory & allkeys-lru

Configure Redis memory limits cleanly so Celery task queues and SSE pub/sub channels stay fast without unbounded key growth.

256-1,024 MB Cap · allkeys-lru · Persistence Safety

Bounding Dify Redis Memory With maxmemory & allkeys-lru
Telemetry baseline verified 2026-10-13 by WorkflowGraph Lab.

Dual Role of Redis in Dify

Redis serves simultaneously as the Celery task broker, result backend, rate-limiter store, and real-time workflow event pub/sub bus. Setting maxmemory with allkeys-lru prevents stale cached objects from crowding out Postgres HNSW pages.

Avoiding Swap Spikes During BGSAVE

Keep at least 2x Redis maxmemory free in host RAM if RDB snapshots are enabled, because Redis fork() duplicates dirty pages identically to Postgres checkpoints.

Measured Thresholds & Container Limits

Workload ProfileRedis maxmemoryEviction Policy
1k - 35k chunks (KVM 2)256mballkeys-lru
35k - 140k chunks (KVM 4)512mballkeys-lru
150k - 250k chunks (KVM 8)1024mballkeys-lru
256-1,024 MB Cap · allkeys-lru · Persistence Safety Deploy KVM ($4.79+/mo)Make.com 10k Free Ops