Describe the problem/error/question
Hello, I would like to share my current n8n setup usage from oct 13 to 01 nov, to share insights and ask for tips or recommended configurations.
What is the error message (if any)?
I have a queue setup running in railway where I have a Redis service, a postgresql database, the main n8n instance and 10 workers.
This has been the usage of the whole setup:
As you can see, postgresql is the service that most ram is using by far, x3 times more than the 10 workers together. I know postgresql is a database with a high memory usage, but how efficient is it while running with n8n?
At the beginning, I had these variables:
EXECUTIONS_DATA_PRUNE_MAX_COUNT=200000
EXECUTIONS_DATA_PRUNE=true
EXECUTIONS_DATA_MAX_AGE=672
But the ram usage was growing and growing and had to re-think the numbers and finally ended up with these values:
EXECUTIONS_DATA_PRUNE_MAX_COUNT=50000
EXECUTIONS_DATA_PRUNE=true
EXECUTIONS_DATA_MAX_AGE=168
Seems the biggest tables are: “execution_data” and “execution_entity” which right now each one has +9k rows.
I still have tons of questions about how n8n manages this data.
- I thought the size of the tables would occupy disk, which they do as well, but where the ram usage is coming from? Stored executions? Or the usage it directly proportional to database size?
- Does n8n automatically “free” the ram usage when pruning happens?
- A week ago I deleted 50k executions from my n8n executions list using a date-range of executions that I don’t need anymore. It had 0 impact on the ram usage, why?
- Should I run a command every few weeks/once a month to “vacuum” somehow the database? It only frees “disk space” or Ram as well?
- Does n8n vacuum the database automatically when the pruning happens?
- What happens when the count is 50k, it overwrites the oldest entry or just deletes an entry? How does it work?
- Each entry in “execution_data” and “execution_entity” it’s an execution from the dashboard? I have 50k, why I only see 9k rows in the database?
Last 7 days of postgresql ram usage:
Also, these logs are triggered by what? The pruning variables?
How often it happen? Can I manually trigger it running a command in n8n CLI or is there any workflow that triggers this?
Thanks!
Information on your n8n setup
- n8n version: 1.11.2
- Database (default: SQLite): Postgresql
- n8n EXECUTIONS_PROCESS setting (default: own, main): queue
- Running n8n via (Docker, npm, n8n cloud, desktop app): Railway
- Operating system: Railway+docker-image