N8n server getting overloaded

Hi Everyone,

I have this VPS: Cloud Compute 1 vCPU, 1024 MB RAM, 25 GB SSD, 1.00 TB Transfer

I am finding if I send Mautic page hit webhooks into n8n to update our crm at busy times the server gets overloaded - CPU gets to 140% and then server is unavailable. I have already batched the webhooks in Mautic so they are sent over ever 2 mins.

Is my server too lower spec or do I need to optimise Mautic in a new way please? e.g. increase the batch time to 5mins.

Thank you

Paul

Should be normally more than enough.

Not sure if I understand correctly. Are you calling a webhook for every request you get or do you have batch task? Or both?

If you receive a lot of requests, especially a lot of requests in parallel, it is probably best if you tell n8n to run all workflow executions in the main process. That is not just way faster it saves a lot of resources.

You can do that by setting:

export EXECUTIONS_PROCESS=main

Here the documentation:

Will it actually save resources on a heavy load?

Each process does not just cause a lot of overhead (CPU & even more memory) it also slows down the start of executions a lot (from instantaneous to ~1 second). Did some tests a while ago the difference between both modes is very huge esp if there are a lot of workflows running in parallel.

If there is only one workflow running at a time the difference is very minimal (except for the startup time).

2 Likes

Hi Jan, Thank you for your reply. I have about 40 workflows running. The most active collects data via a webhook being trigger by Mautic when there is a website page hit. Mautic has an option to batch the webhooks so they are only sent once every x mins. Problem is the n8n server is still being over run.

The runtime of the Mautic page hit workflow varies from .02 of a second to 13 seconds

Is the setting of: export EXECUTIONS_PROCESS=main still what you would recommend please?

Thank you,

Paul

Hi Jan,

I have set EXECUTIONS_PROCESS=main and will see how it goes.

Thanks for your advice!

Paul

Yes, could still make sense. It is maybe also a good idea to try to call the workflow more often instead of less and so reducing the number of items that have to be processed per run.

I have not had any server crashes since making this change!

2 Likes