n8n
n8n copied to clipboard
High CPU usage and unresponsive dashboard after running long Loop workflow
Bug Description
I am self-hosting n8n using Docker on a DigitalOcean droplet with the following specifications:
Regular Intel droplet (1 vCPU, 1 GB RAM) OS: Ubuntu 22.04
I encountered an issue when running a workflow designed to loop approximately 3,000 times.
Workflow Details:
- The workflow sends a photo (fetched from a URL) and a message to a Telegram user.
- It waits 10 seconds, then repeats the process for the next Telegram user.
- The loop continues for all 3,000 Telegram user IDs.
Observed Behavior:
- After approximately 1,000 iterations (450 minutes of runtime), the CPU usage and server load increased significantly.
- The n8n dashboard became unresponsive.
- Other workflows also became extremely slow to execute.
- The workflow started at 15:30 and was manually stopped at around 23:00 due to these issues.
Workflow start at 15:30. I manually stopped it at about 23:00
To Reproduce
- Extract 3,000 Telegram user IDs.
- Create a workflow with a loop that:
- Sends a Telegram message with a photo (hosted on a website and fetched via URL).
- Waits 10 seconds.
- Sends the same content to the next user.
- Monitor the server performance during the workflow execution.
Expected behavior
Expected behavior
- The server load and CPU usage should remain stable even during long-running workflows.
- The n8n dashboard and other workflows should remain responsive throughout.
Actual Behavior:
- Server load and CPU usage become excessively high after prolonged execution of the workflow.
- n8n dashboard and other workflows become unresponsive.
Operating System
Ubuntu Linux 22.04
n8n Version
1.72.1
Node.js Version
20.18.0
Database
SQLite (default)
Execution mode
main (default)