14 November 2026 · 4 min read
Why self-hosted n8n freezes under load, and the setting that fixes it
A self-hosted n8n instance stalled every time real load arrived. The cause was a database connection pool of two. Here is how to spot it and fix it.
After moving a busy production workload from n8n Cloud to a self-hosted server, the editor started freezing. Pages hung for seconds, saving a workflow sometimes timed out, and it always got worse when several scheduled workflows fired together. The server itself had plenty of memory and CPU to spare.
The cause
n8n talks to Postgres through a connection pool, and the default pool size is two connections. On a quiet instance that is fine. On an instance running many workflows at once, every execution, every editor request and every webhook queues behind those two connections. The interface was not slow because the machine was busy; it was waiting in line for the database.
The fix
Raising the pool size with the DB_POSTGRESDB_POOL_SIZE environment variable, from 2 to 15 in this case, removed the stalls immediately. The right number depends on your concurrency and on how many connections your Postgres server allows, so it should be sized rather than guessed.
Other limits worth knowing before they bite
- Maximum payload size: large webhook bodies and big item batches fail at the default limit
- Task runner memory: if it is not set explicitly, it is not unlimited, and Code nodes on large data can be killed
- Container memory: n8n and its task runner share the container limit, so size it for both
- Runner health: if the task runner stops, Code nodes stop. A small hourly canary workflow that alerts Slack catches this
None of these need changing on day one. They need watching, so you raise them when a workflow gets close rather than after it fails.
Seeing this in your own workflows?
Send a note with the tools involved and what you are seeing.
Email me