N8n crashes

We have installed n8n self hosted on an AWS EC2 using Docker. We have about 50 workflows running right now, getting data from an API, throwing it to a Google Sheet, then sending from a Google sheet to another API. All workflows with Cron, so it should be very constant processing during the day. Then seemingly out nowhere something happens…

This is today for instance:

After that i usually get a “502 Bad Gateway”, and I need to reiniciate Docker.

This happened twice in the past two weeks, and weirdly, a friend of mine who hosts n8n on another server experienced the same cpu peak on the same days at the same time.

Share the output returned by the last node

Information on your n8n setup

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

Can you please fill in the information above.

Sure, I added the setup information I have. I did not understand the question about the execution process, but my engineer followed the documentation for Docker install.

Thanks a lot. But in this case is actually that piece of information the most important one. But assuming that you run n8n in the default which is “own”.

In this case it is probably a good idea to change it to “main” mode. You can find the docs here.

In the end, what you have to do is set the environment variable EXECUTIONS_PROCESS=main. This will ensure that n8n does not start a new process for each execution. Check if that solves the issue for you.

Generally are CPU spikes no problem, all that would happen then is that n8n gets slow, what is however a problem is when n8n runs out of memory and this setting should help with that.

2 Likes

We implemented the change, will let you know if it gets better. Thank you the help as always.

You are welcome. :crossed_fingers:

The change to “main” has dramatically reduced usage!!

2 Likes

That is great to hear!

Have fun!

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