Loader

n8n Performance Tuning: Fix Memory Errors and Slow Workflows

Slow editor, killed containers and workflows that never finish usually come from a few causes. Here is how to find and fix them.

  • Find the bottleneck
  • Batching and sub-workflows
  • Pruning and scaling
n8n Performance Tuning: Fix Memory Errors and Slow Workflows
  • 26 October 2026
  • by Admin

n8n Performance Tuning: Fix Memory Errors and Slow Workflows

Most n8n performance problems fall into three groups: running out of memory, a database that has grown too large, and workflows that process too much data at once. Fix them in this order.

1. Confirm what is happening

docker stats
docker compose logs --tail 200 n8n
docker inspect n8n --format '{{.State.OOMKilled}}'

If the last command shows true, the container was killed for using too much memory. If the CPU is high all the time, look at the Code node and parallel workflows.

2. Process data in smaller batches

  • Use the Split In Batches (Loop Over Items) node to handle 100 or 500 items at a time instead of 50,000.
  • Ask APIs for pages of results and process each page, rather than downloading everything first.
  • Avoid keeping large files in memory. Move large binary data through storage and pass links instead.

3. Split big workflows into sub-workflows

A main workflow can call a sub-workflow for each batch. Memory used by the sub-workflow is freed when it finishes, so peak memory stays lower. Smaller workflows are also easier to debug.

4. Reduce stored execution data

  • Turn on pruning so old executions are deleted automatically.
  • Do not save successful executions for high-volume workflows that you do not need to inspect.
  • Use Postgres, and keep an eye on its size.
EXECUTIONS_DATA_PRUNE=true
EXECUTIONS_DATA_MAX_AGE=168
EXECUTIONS_DATA_SAVE_ON_SUCCESS=none

These settings can differ by version. Check the n8n documentation for the one you run.

5. Give Node.js enough memory

The server needs the RAM first. Adding a Node memory option does not help if the machine has none to spare. After you upgrade the VPS, you can raise the Node heap limit if needed, for example with the NODE_OPTIONS=--max-old-space-size=3072 setting on a 4 GB server. Leave room for the OS and the database.

6. Use a faster disk and database

SSD or NVMe storage and Postgres make the editor and executions feel much faster than SQLite on a slow disk. See the sizing table in n8n self-hosting requirements.

7. Scale out

When one process is simply too busy, move to queue mode with workers, as explained in n8n queue mode explained. Or upgrade to a larger VPS. See which VPS plan fits which n8n workload.

A quick checklist

  • Batch large data.
  • Split big workflows.
  • Prune executions.
  • Match server RAM to the workload.
  • Add workers only after the basics are fixed.

Need more RAM or a tuned setup? Compare our Linux VPS plans or ask us for advice.

View Linux VPS Plans

Frequently asked questions

  • Why does my n8n container keep restarting?
    A common reason is running out of memory. Check docker inspect for OOMKilled and look at the logs. Give the server more RAM or process less data at once.
  • Does pruning execution data make n8n faster?
    Yes. A smaller database means faster queries and a faster editor.
  • Do I need queue mode to fix slow workflows?
    Not always. Try batching, sub-workflows, pruning and a bigger server first.