Slow http-request node

Describe the issue/error/question

Http-request node takes several seconds to do a simple GET request.

  • n8n it’s running in kubernetes with an external PG
  • assigning more resources (cpu/mem) does not change the results
  • Doing the whole flow in the console (curl) takes an avg of 4s
  • When webhook is set to immediate response, it only takes 0.2s

Are this numbers expected?

Any clue will be appreciated as I am going crazy with this issue

Please share the workflow

Information on your n8n setup

  • n8n version: 0.159.1
  • Database you’re using (default: SQLite): PG13
  • Running n8n with the execution process [own(default), main]: main
  • Running n8n via [Docker, npm, n8n.cloud, desktop app]: kubernetes

More debugging,

I set up n8n locally with docker and default options, when I run same experiment I get this:

So time is cut in half, still seems slow for such a simple flow but is much better, as expected, as all the laptop resources are available for n8n.

How could I debug where is the bottleneck?

If I use the default mode (not ‘main’) the time is 2x slower

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.

3 Likes

Hi jasl,

This looks very similar to an issue I had. Are you using SWAG from LSIO by any chance?

My thread is here - the solution sped it up quite a lot but still not as fast as when I access n8n directly via the IP (bypassing SSL).

Let me know if you find a better solution!

1 Like