TUNING 01
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
Eliminate OOM kills across Dify api, worker, web, pgvector, redis, weaviate/qdrant, sandbox, ssrf_proxy, and nginx using deterministic Compose limits and .env flags.
TUNING 01
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
TUNING 02
Calculate exact 1536-dimension HNSW memory footprint from 1k to 250k chunks and tune shared_buffers + maintenance_work_mem.
~14.5 MB / 1k Chunks · 25% RAM shared_buffers · Zero Disk Thrash
TUNING 03
Balance SERVER_WORKER_AMOUNT against available RAM so 50-200 concurrent SSE streaming users never exhaust memory.
~310 MB / Gunicorn Worker · gevent SSE Multiplexing
TUNING 04
Prevent Node.js V8 heap expansion inside dify-web from creeping past 1.2 GB on long-running Studio editing sessions.
320-580 MB Steady · --max-old-space-size=768 · Zero Creep
TUNING 05
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
TUNING 06
Isolate untrusted workflow Python/Node code execution and outbound HTTP tool fetches with strict memory ceilings and timeouts.
280-1,400 MB Sandbox · 140 MB Squid SSRF · Zero Escape
TUNING 07
Understand how reducing chunk size from 1,000 tokens to 400 tokens multiplies HNSW vector count 2.5x and inflates pgvector RAM.
2.5x Vector Bloat at 400 Tokens · 4,000 Max Seg Len
TUNING 08
Never edit upstream Dify docker-compose.yaml directly—layer memory caps, Postgres flags, and Redis limits cleanly via override.
Zero Git Merge Conflicts · Deterministic Container Limits
TUNING 09
Move scheduled polling, OAuth refreshes, and multi-app webhooks out of Dify Python workers into Make.com Pro (10,000 free ops month 1).
Saves 620-1,500 MB RAM · Keeps 8 GB KVM 2 Safe
TUNING 10
Add a 2-4 GB compressed zram safety net and set vm.swappiness=10 so sudden PDF ingestion bursts slow gracefully instead of OOM-killing Postgres.
vm.swappiness=10 · 2-4 GB zram · Zero Sudden OOM Kill
| Vendor & Tier | Compute & NVMe | Intro / Base | Renewal | Terms | Dify 9-Container Fit | Link |
|---|---|---|---|---|---|---|
| Hostinger KVM 2 — KVM 2 NVMe (8 GB RAM / 2 vCPU EPYC) | 2 vCPU EPYC · 8 GB RAM · 100 GB NVMe | $4.79/mo | $10.99/mo | 24-mo intro / 8 TB transfer | 1k-35k RAG chunks · 2-4 Celery workers · 5-25 concurrent chatflows | Open Hostinger KVM 2 |
| Hostinger KVM 4 — KVM 4 NVMe (16 GB RAM / 4 vCPU EPYC) | 4 vCPU EPYC · 16 GB RAM · 200 GB NVMe | $9.99/mo | $19.99/mo | 24-mo intro / 16 TB transfer | 35k-140k chunks · 4-8 Celery workers · pgvector HNSW + Sandbox | Open Hostinger KVM 4 |
| Hostinger KVM 8 — KVM 8 NVMe (32 GB RAM / 8 vCPU EPYC) | 8 vCPU EPYC · 32 GB RAM · 400 GB NVMe | $19.99/mo | $39.99/mo | 24-mo intro / 32 TB transfer | 150k-250k chunks · 8-16 Celery workers · 100-200 parallel workflows | Open Hostinger KVM 8 |
| Make.com Pro — Pro 10,000 Ops Hybrid Offload | 10,000 Free Ops Month 1 · Visual Webhook Router | $0.00/mo | $18.82/mo | 1st Mo Free Pro / Core $10.59/mo | Offloads CRM/Slack/Drive polling out of Dify Celery & Sandbox | Open Make.com Pro |
| Vultr High Frequency 16 GB — HF NVMe (4 vCPU 3.8+ GHz / 16 GB) | 4 vCPU 3.8+ GHz · 16 GB RAM · 256 GB NVMe | $96.00/mo | $96.00/mo | Hourly elasticity / $300 promo eligible | Burst PDF chunk ingestion & temporary RAG re-indexing windows | Open Vultr High Frequency 16 GB |
| UltaHost VDS 32 GB — Dedicated VDS (8 Dedicated Cores / 32 GB) | 8 Dedicated Cores · 32 GB RAM · NVMe | $68.50/mo | $68.50/mo | Dedicated CPU isolation / Unmetered port | High-concurrency Dify enterprise team workloads without CPU steal | Open UltaHost VDS 32 GB |
Rates verified 2026-10-13 by WorkflowGraph Lab. Promotional introductory pricing and standard renewal terms are listed explicitly side by side.