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

Fixing Dify Celery Worker RAM Spikes & OOM Kills

Control CELERY_WORKER_AMOUNT and gevent concurrency so batch PDF/DOCX extraction never multiplies RSS past host RAM.

420-650 MB / Worker · gevent Pool · Safe Autoscale Caps

Fixing Dify Celery Worker RAM Spikes & OOM Kills
Telemetry baseline verified 2026-10-13 by WorkflowGraph Lab.

Why Default Celery Unbounded Forks Crash 8 GB VPS Nodes

Each Dify Celery worker loads Python NLP tokenizers, Unstructured/PDF parsers, and embedding client libraries into resident memory (~420-650 MB per process). Spawning 8+ workers during bulk knowledge-base uploads instantly triggers the Linux OOM killer on 8 GB hosts.

Autoscale Bounds in .env

Set CELERY_AUTO_SCALE=true alongside explicit CELERY_MIN_WORKERS and CELERY_MAX_WORKERS matching your VPS tier, and wrap the worker service in a Docker deploy.resources.limits.memory cap.

Measured Thresholds & Container Limits

Host VPS RAMSafe CELERY_WORKER_AMOUNTWorker Container Limit
8 GB (KVM 2)2 workers1,536M - 2,048M
16 GB (KVM 4)4 - 6 workers3,072M - 4,096M
32 GB (KVM 8)8 - 12 workers6,144M - 8,192M
420-650 MB / Worker · gevent Pool · Safe Autoscale Caps Deploy KVM ($4.79+/mo)Make.com 10k Free Ops