Skip to content

Firsthand.today

Self-hosted n8n on a 2GB VPS falls over when three workflows run at once. Queue mode or just more RAM?

Summary

An agency runs n8n in Docker with Postgres on a 2 vCPU, 2GB VPS for about 40 client workflows; when three heavy ones fire together, executions hang and the kernel kills the node process. They ask whether queue mode with Redis and a worker is warranted or more RAM is the answer.

What the comments say

  • Queue mode keeps the editor alive by moving executions to a worker, but on 4GB the main process, one worker, Postgres and Redis already coexist; a browser node alone can take 300-400MB per execution, so three scraping runs exceed 2GB before swap helps. Cap worker concurrency at 2 with N8N_CONCURRENCY_PRODUCTION_LIMIT and stagger scraping schedules by ten minutes.

    — AlexeyAnshakov · Reddit
  • N8N_CONCURRENCY_PRODUCTION_LIMIT also works in regular mode without Redis or a worker, so it can go on the current 2GB box today: set it to 2 and the third heavy run waits in a first-in, first-out queue instead of loading into memory. It is off by default and only counts webhook and trigger runs, so manual and sub-workflow runs are not limited.

    — Ok-Distance-6388 · Reddit
  • Queue mode on the same 2GB box adds Redis and worker process overhead, so it makes memory pressure worse, not better; it only pays off once the worker runs on its own machine. Upgrading to 4-8GB fixes the client-facing problem in minutes and is cheaper than missed webhooks.

    — Typical_GeorgeJungle, MeasurementGreat5273, EggplantStrong1697 · Reddit
  • Moving the scraping workflows off the n8n box, to a second cheap VPS or a scraping API that posts results back via webhook, stops the webhooks from dying immediately; execution pruning (EXECUTIONS_DATA_PRUNE plus EXECUTIONS_DATA_MAX_AGE) and N8N_DEFAULT_BINARY_DATA_MODE=filesystem keep Postgres bloat from quietly eating memory.

    — sgayerseif, MeasurementGreat5273 · Reddit
  • Setting NODE_OPTIONS=--max-old-space-size=1024 on the n8n container turns a kernel OOM kill into a single failed execution that can be retried, keeping the editor and in-flight webhooks alive; set it slightly under any Docker memory limit since Node does not see the container limit on its own.

    — SignalLayerOps, MeasurementGreat5273 · Reddit
  • Webhook nodes set to respond immediately instead of waiting for the workflow to finish return a 200 to the sender even when the box is slow, and not saving successful executions keeps Postgres from bloating on a small instance.

    — sebastian_lgn, EggplantStrong1697 · Reddit

Join the discussion

Was this useful to you?