I am building a workflow that uses OpenAI to write blog posts. This workflow passes through a lot of data. I scrape 10 web pages, create a database index, generate images with openAI. One execution can weight around 10MB. The workflow itself has around 20 nodes.
There are no error messages but sometimes the entire n8n platform response time can reach 20 seconds! It happens when I try opening the front page with the list of workflows, load executions, try executing a note, opening settings, basically any action can randomly take a super long time. The most annoying is waiting for “executing previous nodes” before a test node execution while all previous nodes already have data in them. After that huge delay, a chain of nodes can be executed quickly without any delay. And on the next request, here we go again…
It hasn’t happened before with the same workflow, it just became super slow one day. Sometimes it might execure/load page as normal, sometimes might take a solid 20 seconds. There are no other executions or intense tasks running on the server, I’ve been monitoring the server performance and the only bottleneck seems to be that one processor core randomly getting loaded 100% while others just chilling.
To be clear, there are no errors. Just the response time drop fairly often.
My assumption 1:
My prev executions are too heavy (although disk io nor memory were not the bottleneck) so I used these variables. Didn’t solve the issue.
EXECUTIONS_DATA_PRUNE=true
EXECUTIONS_DATA_MAX_AGE=336
EXECUTIONS_DATA_PRUNE_MAX_COUNT=1000
My assumption 2:
Due to 10 web pages cached while test execution, the platform has to send them back and forth when executing the next node in test mode. But if that’s true why opening settings can trigger that enormous delay?
Worth noting that when I use production webhooks, everything seems okay. Only the UI part that’s struggling (with a number of devices tested).
I’m using Docker, 4 core CPU, 4GM RAM and 20GB storage
Thank you in advance!
edit:
n8n version - 1.18
database - sqlite
OS - linux