N8n as data source for SaaS apps ... Good / Bad idea?

Hey Guys,

Have a question on scaling n8n in a self-hosted setup. I often use n8n as the data source through Webhooks. This works wonderful because development and product iteration is very fast.
Given the low number of users, this setup works very good.

It easily manages 10 connections supported by 10 worker processes currently.

If this were to scale to 1000 concurrent users, is there a way to setup n8n to handle it? Scaling hardware is fine too.

Any thoughts? @jan

Hey @Santosh_Srinivas,

No need to tag Jan unless you specifically want a reply from him and not anyone else in the team but I suspect that is not the case :wink:

If you have 10 worker processes you should be able to handle more than just 10 connections, in my local test environment I managed to hit 72 concurrent connections without really doing anything. By using queue mode you could in theory scale as much as you need it to and as needed just fire up another webhook worker and add it to your load balancers server pool.

1 Like

Thanks @Jon :smiley:

Any experience on handling 1000 concurrent users? I’m guessing that the team would have got to evaluate such a situation in the past and would love to know any learnings they had.

Would you say that the queue mode setup should work fine?

A tech expert told me that n8n would never be able to handle it yesterday evening and hence just want to a sanity check based on your prior experience.

Hey @Santosh_Srinivas,

Queue mode will work fine and it is designed to handle larger loads, In your case you would be after multiple webhook workers. There isn’t really anything that complicated to it either, Make sure your load balancer is configured correctly to send the webhook traffic to those workers and assuming your redis instance and database can handle the connections you would just need to add webhook workers as needed.

We did publish some info in our docs a while back and a GitHub repo for benchmarking and in our small test we were able to get 2500 concurrent connections with just 2 webhook workers until it starting to take longer to respond and on a single instance without queue mode it was around 220 concurrent connections. You can find this information here: Performance and benchmarking | n8n Docs

I would love to know why the tech expert believes it would never be able to handle it :smiley:

1 Like

Thank you @Jon … that’s all I wanted to hear.

I get tired of hyper performance optimisation arguments before getting anywhere close to product market fit. But then, its always good to check I guess :smiley:

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.