The main factor would probably be that n8n has to wait until it receives a response from the server to which you make that request via the HTTP Request node. If you just want to see the speed of n8n itself, it is best to deactivate that HTTP Request Node but still leave the Webhook-Node set to return data of the last node (which would be in this case the Webhook-Node itself).
The only other thing I can currently think of that could cause a slowdown would be Postgres and the connection to it. If you also want to rule that out it is best to test with an SQLite database.
I am also facing the same issue,
when n8n webhook is called for prod environment it takes 4 seconds to respond but
when n8n webhook is called for a local setup it takes 1.8 seconds whereas
API’s written without n8n responds in 750 milliseconds.
All the three test scenarios are used to query PostgreSQL database.
can you suggest some methods which we can follow to optimise(reduce) wait time @jan@MutedJam@RicardoE105
Can you open a new thread and include how you have n8n setup, It would also be handy to know what you mean by local setup and prod environment and what the differences are between them.
@Jon local setup - n8n running in my system via n8n npm package
prod setup - n8n hosted in a server and n8n runs in a docker container.
I got the solution for slowness, when I added EXECUTIONS_PROCESS=main in env, now its blazing fast
That can be it, So when you use the default mode it fires up a process to handle it which can take a bit of time to do. Desktop I think has it set to main as a default option.
I also have this problem, but if you change to EXECUTIONS_PROCESS=main in env, all the workflows on that entire server is affected right? Or could you do this for a specific workflow?
Ah ok, thank you. It didn’t really make a change for me though, have no idea why yet. I hire a very small virtual server on Hetzner so maybe it’s too weak.
I get the same result, about 3-4 seconds on both, a very simple json return from a function. But as has been written here before, if I disconnect the function from the webhook and just choose immediate response I get like 40-50 ms.
I also have a n8n pro cloud account and there I get around 1 second, so much faster there too it seems, and I guess the cloud uses the own setting.
That is very odd, Can you share your workflow so I can test it on my local install? When you have been testing have you been using Docker, NPM or Desktop?
Sure, thanks for helping me!
It’s really almost nothing in there though, now I’m just testing with a webhook and a return function and it’s still the same:
Just tried a huge server on Hetzner and got it down to 2-3 seconds. Also, tried it on desktop and got 100-150 ms so there’s a huge difference at least. I must do something wrong with the EXECUTIONS_PROCESS=main.
How are you running n8n on the server? If we can get that and how you are setting the environment variable we should be able to get to the bottom of this one.
Will run the workflow shortly to see what happens.
Chose a larger machine on Hetzner again and got it down to 1,5-2 seconds. But executions=main still doesn’t do anything so maybe I’m doing something wrong with the .env-file?