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

Tuning Dify Flask/Gunicorn API Workers for SSE Chatflows

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 Dify Flask/Gunicorn API Workers for SSE Chatflows
Telemetry baseline verified 2026-10-13 by WorkflowGraph Lab.

Gevent Greenlets vs Process Forking

Each Gunicorn worker process consumes ~310 to 400 MB baseline. Using SERVER_WORKER_CLASS=gevent lets a single worker sustain dozens of idle-waiting LLM upstream HTTP streams concurrently rather than scaling worker processes 1:1 with users.

Matching Workers to vCPU Count

Keep SERVER_WORKER_AMOUNT between 1x and 1.5x physical vCPU count on KVM nodes to avoid context-switch overhead while Celery ingestion is also active.

Measured Thresholds & Container Limits

Concurrent ChatflowsSERVER_WORKER_AMOUNTapi Container Limit
5 - 25 runs2 gevent workers1,280M
30 - 80 runs4 - 6 gevent workers2,560M
100 - 200 runs8 - 10 gevent workers4,608M
~310 MB / Gunicorn Worker · gevent SSE Multiplexing Deploy KVM ($4.79+/mo)Make.com 10k Free Ops