I'm planning to deploy n8n on Railway.com and I'm particularly interested in performance and scalability.

wuyifannppp
FREE

9 days ago

What are the recommended resource allocations (CPU, RAM) for a standard n8n instance on Railway to ensure good performance?

Are there any specific n8n environment variables or Railway settings that can optimize performance, especially for workflows with high concurrency or long-running tasks?

For horizontal scaling of n8n, what's the recommended approach on Railway (e.g., using multiple instances, load balancing)? How does this impact shared data like credentials and workflows?

Solved$10 Bounty

2 Replies

gauhar-1
FREE

9 days ago

Recommended resource allocations:

CPU: 1–2 vCPU

RAM : 2–4 GB

############# n8n Environment Variables ##########

# Enable queue mode for concurrency and scaling

EXECUTIONS_MODE=queue

QUEUE_MODE=redis

EXECUTIONS_PROCESS=queue

# Optional performance tuning

EXECUTIONS_TIMEOUT=3600

EXECUTIONS_CONCURRENCY=10

EXECUTIONS_DATA_SAVE_ON_ERROR=all

# PostgreSQL DB for workflow and credential storage

DB_TYPE=postgresdb

DB_POSTGRESDB_HOST=<your_postgres_host>

DB_POSTGRESDB_PORT=5432

DB_POSTGRESDB_DATABASE=<your_database>

DB_POSTGRESDB_USER=<your_user>

DB_POSTGRESDB_PASSWORD=<your_password>

# Redis for queue

N8N_REDIS_HOST=<your_redis_host>

N8N_REDIS_PORT=6379

N8N_REDIS_PASSWORD=<your_redis_password>

######### Horizontal Scaling ###########

  1. Add PostgreSQL plugin to your project.

  2. Add Redis plugin (or use Upstash).

  3. Set all the env vars above.

  4. Go to:
    Railway → Your n8n Service → Settings → Scaling

    Set to:
    Min Replicas: 1

    Max Replicas: 3 (or more)

    CPU Threshold: 70%

  5. Save and redeploy the service.


Anonymous
FREE

7 days ago

Railway provides templates and capabilities to deploy these components, enabling n8n to achieve high performance and scalability:

  • Use Railway's n8n Pro Stack Template: Railway officially offers an "n8n Pro Stack" template, which pre-configures the n8n main application, Worker, Redis, and PostgreSQL. This is the recommended starting point as it's already optimized for scalability.

    • Pros: One-click deployment, includes all necessary components, simplifies configuration and management.

  • Separate Services: Ensure you deploy each n8n component (main application, Worker, Redis, PostgreSQL) as a separate service on Railway. This allows each service to be scaled independently.

    • n8n Main Application: Handles UI and API requests.

    • n8n Worker: Responsible for actual workflow execution. By increasing the number of Worker instances, you can significantly boost concurrent execution capabilities.

    • Redis: Provides fast message passing and caching, reducing latency between the main application and Workers.

    • PostgreSQL: Serves as reliable data storage.


Status changed to Solved chandrika 7 days ago