I Run n8n in Both Modes. Queue Mode's Peak Load: 19 Jobs
说明与用途
文章比较了 n8n 的单进程模式和队列模式。队列模式在一周内处理了 76,100 次执行,使用约 900 MiB 更多 RAM,并出现迁移竞争问题,但提供了崩溃隔离和无缝重启。选择应基于任务持续时间和资源影响,而非单纯的执行次数。
问题
Deciding whether to run n8n in single‑process or queue mode when handling high execution volume and ensuring availability.
结果
Queue mode handled 76,100 executions with only 19 concurrent jobs, providing crash isolation and restart safety at the cost of ~900 MiB extra RAM and migration race complexity.
工作流
- 1. Deploy two identical n8n instances (queue and single‑process).
- 2. Run both for 7 days, collecting execution counts, concurrency, RAM usage, and success rates via SQL queries and docker stats.
- 3. Analyze peak concurrent executions (queue: 19, single: 1).
- 4. Evaluate RAM consumption (queue: 456+445 MiB, single: 507 MiB).
- 5. Identify benefits: crash isolation, restart behavior, scaling path.
- 6. Identify costs: migration race, silent worker failures, extra RAM.
- 7. Decide mode based on workload characteristics (sub‑second traffic vs. long/memory‑heavy runs).
证据
At the single busiest moment of those 76,100 runs, exactly 19 executions were in flight at once.
Queue mode costs me roughly 900 MiB of n8n processes to do what the regular instance does in 507 MiB.
The migration race. Every version upgrade, docker compose up -d starts main and worker together, and both immediately try to run database migrations on the same Postgres.
- 记录日期: 2026-09-05T18:15:27.642Z