Tips > Reliability & Performance

Set Production Concurrency Limits to Prevent Resource Exhaustion

Without concurrency limits, n8n will attempt to execute as many workflows simultaneously as events arrive.

TipAdvanced2 min read

Without concurrency limits, n8n will attempt to execute as many workflows simultaneously as events arrive. During traffic spikes or bulk operations, this can exhaust memory, saturate CPU, and crash the process.

Real-world example: A webhook endpoint receives 500 events in 10 seconds during a bulk import. n8n attempts to execute 500 workflows concurrently, consuming 8 GB of RAM and crashing the container.


# .env configuration

# Limit concurrent production (webhook/trigger) executions

N8N_CONCURRENCY_PRODUCTION_LIMIT=20

# For queue mode workers, set per-worker concurrency

# (set this on each worker's environment)

QUEUE_WORKER_CONCURRENCY=10
```text
Sizing guidelines:

| Deployment Size | RAM | Recommended `N8N_CONCURRENCY_PRODUCTION_LIMIT` |
|:---------------|:----|:----------------------------------------------|
| Small (2 GB RAM) | 2 GB | 5-10 |
| Medium (4 GB RAM) | 4 GB | 15-25 |
| Large (8 GB RAM) | 8 GB | 30-50 |
| Queue worker | 4 GB | 10-15 per worker |

```bash

# Full production-optimized .env example

N8N_CONCURRENCY_PRODUCTION_LIMIT=20
EXECUTIONS_MODE=queue
QUEUE_BULL_REDIS_HOST=redis
QUEUE_WORKER_CONCURRENCY=10
N8N_PAYLOAD_SIZE_MAX=128
N8N_DEFAULT_BINARY_DATA_MODE=filesystem
EXECUTIONS_DATA_PRUNE=true
EXECUTIONS_DATA_MAX_AGE=168
EXECUTIONS_DATA_SAVE_ON_SUCCESS=none
EXECUTIONS_DATA_SAVE_ON_ERROR=all
NODE_OPTIONS=--max-old-space-size=4096
DB_TYPE=postgresdb
```text
> **Warning: Backpressure Behavior**
>
> When the concurrency limit is reached, new executions queue up in memory (main mode) or in Redis (queue mode). In main mode, if too many executions queue up, the process can still run out of memory. Queue mode with Redis is the robust solution for high-throughput workloads.

**Related:** [Flatten Deeply Nested API Responses](../code-node-mastery/01-flatten-deeply-nested-api-responses.md) | [Use Docker Compose with Health Checks for n8n and PostgreSQL](../self-hosting-operations/01-use-docker-compose-with-health-checks-for-n8n-and-postgresql.md)

Want this running in your stack?

I build production n8n and Cloudflare automation for teams — the same engineering behind HarperFlow. Fixed-price, escrow-protected, US-based.