Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

Cloudron Forum

Apps | Demo | Docs | Install
  1. Cloudron Forum
  2. N8N
  3. trying to scale N8N

trying to scale N8N

Scheduled Pinned Locked Moved N8N
n8n
20 Posts 7 Posters 3.3k Views 8 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • R Offline
      R Offline
      roofboard
      wrote on last edited by roofboard
      #1

      I am running into this problem with N8N under heavy load it will easily take down Cloudron. On the N8N website they talk about "queue mode" where one instance of N8N drives another.

      It is important to have n8n using postgres or mysql
      And it is important to have redis running to direct the sub instances.

      beyond that... I am wondering if it is going to be possible to make this happen while using Cloudron.

      I have the current problem where a load spike will bring in 2000 requests in a few minutes which reliably crashes N8N. It seems premature to upgrade the whole server just to handle a load spike.

      https://docs.n8n.io/hosting/scaling/queue-mode/

      Any ideas?

      MooCloud_MattM girishG 2 Replies Last reply
      2
      • R roofboard

        I am running into this problem with N8N under heavy load it will easily take down Cloudron. On the N8N website they talk about "queue mode" where one instance of N8N drives another.

        It is important to have n8n using postgres or mysql
        And it is important to have redis running to direct the sub instances.

        beyond that... I am wondering if it is going to be possible to make this happen while using Cloudron.

        I have the current problem where a load spike will bring in 2000 requests in a few minutes which reliably crashes N8N. It seems premature to upgrade the whole server just to handle a load spike.

        https://docs.n8n.io/hosting/scaling/queue-mode/

        Any ideas?

        MooCloud_MattM Offline
        MooCloud_MattM Offline
        MooCloud_Matt
        wrote on last edited by
        #2

        @roofboard
        You should expose psql, and keep the credentials the save.
        And both are feature not currently available in Cloudron

        Matteo. R.
        Founder and Tech-Support Manager.
        MooCloud MSP
        Swiss Managed Service Provider

        1 Reply Last reply
        0
        • subvenS Offline
          subvenS Offline
          subven
          wrote on last edited by
          #3

          n8n in queue mode using workers seems similiar to GitLab using GitLab Runner but it isn't.

          n8n workers are seperate instances acting as workers for the main instance so it's easy to scale. For n8n on Cloudron I don't see this as beneficial since you could just increase the usable ressources for your n8n app. Starting another n8n as worker would just produce some overhead on your system. To add n8n worker instances from somewhere outside of your Cloudron, Redis and the database has to be reachable from the outside which has not been the case so far.

          So if your single instance brings down your server, maybe try to increase usable CPU/RAM/SSD ressources and if this is not sufficient, scale up your server?

          MooCloud_MattM 1 Reply Last reply
          1
          • subvenS subven

            n8n in queue mode using workers seems similiar to GitLab using GitLab Runner but it isn't.

            n8n workers are seperate instances acting as workers for the main instance so it's easy to scale. For n8n on Cloudron I don't see this as beneficial since you could just increase the usable ressources for your n8n app. Starting another n8n as worker would just produce some overhead on your system. To add n8n worker instances from somewhere outside of your Cloudron, Redis and the database has to be reachable from the outside which has not been the case so far.

            So if your single instance brings down your server, maybe try to increase usable CPU/RAM/SSD ressources and if this is not sufficient, scale up your server?

            MooCloud_MattM Offline
            MooCloud_MattM Offline
            MooCloud_Matt
            wrote on last edited by
            #4

            @subven
            More or less it's correct but the difference is that n8n workers need access to db and redis for the queue.
            And they don't work correctly (they add a lot of delay) if you use webhook

            Matteo. R.
            Founder and Tech-Support Manager.
            MooCloud MSP
            Swiss Managed Service Provider

            subvenS R 2 Replies Last reply
            0
            • MooCloud_MattM MooCloud_Matt

              @subven
              More or less it's correct but the difference is that n8n workers need access to db and redis for the queue.
              And they don't work correctly (they add a lot of delay) if you use webhook

              subvenS Offline
              subvenS Offline
              subven
              wrote on last edited by
              #5

              @MooCloud_Matt said in trying to scale N8N:

              @subven
              the difference is that n8n workers need access to db and redis for the queue.

              On Cloudron itself with multiple n8n instances running, this would be no problem because of Cloudrons Addons and Docker magic. Still not beneficial like I said.

              1 Reply Last reply
              0
              • MooCloud_MattM MooCloud_Matt

                @subven
                More or less it's correct but the difference is that n8n workers need access to db and redis for the queue.
                And they don't work correctly (they add a lot of delay) if you use webhook

                R Offline
                R Offline
                roofboard
                wrote on last edited by roofboard
                #6

                @MooCloud_Matt said in trying to scale N8N:

                ference is that n8n workers need access to db and redis for the queue.
                And they don't work correctly (they add a lot of del

                The delay is actually what I was most excited about. N8N is really happy to crash load spikes which may only last a few minutes. I was hoping that queue mode would allow me to handle 5000 requests over say... 5 minutes, and then work them over the course of an hour....

                MooCloud_MattM 1 Reply Last reply
                1
                • R roofboard

                  @MooCloud_Matt said in trying to scale N8N:

                  ference is that n8n workers need access to db and redis for the queue.
                  And they don't work correctly (they add a lot of del

                  The delay is actually what I was most excited about. N8N is really happy to crash load spikes which may only last a few minutes. I was hoping that queue mode would allow me to handle 5000 requests over say... 5 minutes, and then work them over the course of an hour....

                  MooCloud_MattM Offline
                  MooCloud_MattM Offline
                  MooCloud_Matt
                  wrote on last edited by
                  #7

                  @roofboard
                  just 2 note on that:

                  • remember that N8N is not an OpenSource project but a Sustainable Use License/faircode so you have to pay if your income on it is more than 5k /y (you should check on their website for the number I just remember that number. )
                  • In that case it can improve stability using n8n in queue mode, but do it outside cloudron, or at least that's my suggestion, and use the response to the webhook at the start, do not w8 the process to finish to replay or if a worker crashes your request queue/accepted by that worker will not be replied.

                  Matteo. R.
                  Founder and Tech-Support Manager.
                  MooCloud MSP
                  Swiss Managed Service Provider

                  jdaviescoatesJ 1 Reply Last reply
                  0
                  • MooCloud_MattM MooCloud_Matt

                    @roofboard
                    just 2 note on that:

                    • remember that N8N is not an OpenSource project but a Sustainable Use License/faircode so you have to pay if your income on it is more than 5k /y (you should check on their website for the number I just remember that number. )
                    • In that case it can improve stability using n8n in queue mode, but do it outside cloudron, or at least that's my suggestion, and use the response to the webhook at the start, do not w8 the process to finish to replay or if a worker crashes your request queue/accepted by that worker will not be replied.
                    jdaviescoatesJ Offline
                    jdaviescoatesJ Offline
                    jdaviescoates
                    wrote on last edited by
                    #8

                    @MooCloud_Matt said in trying to scale N8N:

                    remember that N8N is not an OpenSource project but a Sustainable Use License/faircode so you have to pay if your income on it is more than 5k /y (you should check on their website for the number I just remember that number. )

                    I don't see any such numbers over at https://github.com/n8n-io/n8n/blob/master/LICENSE.md

                    I use Cloudron with Gandi & Hetzner

                    MooCloud_MattM 1 Reply Last reply
                    0
                    • jdaviescoatesJ jdaviescoates

                      @MooCloud_Matt said in trying to scale N8N:

                      remember that N8N is not an OpenSource project but a Sustainable Use License/faircode so you have to pay if your income on it is more than 5k /y (you should check on their website for the number I just remember that number. )

                      I don't see any such numbers over at https://github.com/n8n-io/n8n/blob/master/LICENSE.md

                      MooCloud_MattM Offline
                      MooCloud_MattM Offline
                      MooCloud_Matt
                      wrote on last edited by
                      #9

                      @jdaviescoates
                      I was not sure about that, after the change to fair code license, but it was written on the Commons Clause License.

                      Matteo. R.
                      Founder and Tech-Support Manager.
                      MooCloud MSP
                      Swiss Managed Service Provider

                      1 Reply Last reply
                      0
                      • R roofboard

                        I am running into this problem with N8N under heavy load it will easily take down Cloudron. On the N8N website they talk about "queue mode" where one instance of N8N drives another.

                        It is important to have n8n using postgres or mysql
                        And it is important to have redis running to direct the sub instances.

                        beyond that... I am wondering if it is going to be possible to make this happen while using Cloudron.

                        I have the current problem where a load spike will bring in 2000 requests in a few minutes which reliably crashes N8N. It seems premature to upgrade the whole server just to handle a load spike.

                        https://docs.n8n.io/hosting/scaling/queue-mode/

                        Any ideas?

                        girishG Offline
                        girishG Offline
                        girish
                        Staff
                        wrote on last edited by girish
                        #10

                        @roofboard Per this doc, the default is EXECUTIONS_PROCESS=own. This spins us processes for each execution - so 2000 processes in your case. Have you tried with EXECUTIONS_PROCESS=main ? Also, be sure to bump up the memory limit. Note the memory limit is an upper limit, so once the burst goes away, other apps can use it.

                        2000 requests doesn't seem like much at all to warrant additional workers and complexity (of course, this depends on what the execution is doing). Is it just i/o stuff?

                        There is also a good explanation of all this here.

                        R 1 Reply Last reply
                        1
                        • girishG girish

                          @roofboard Per this doc, the default is EXECUTIONS_PROCESS=own. This spins us processes for each execution - so 2000 processes in your case. Have you tried with EXECUTIONS_PROCESS=main ? Also, be sure to bump up the memory limit. Note the memory limit is an upper limit, so once the burst goes away, other apps can use it.

                          2000 requests doesn't seem like much at all to warrant additional workers and complexity (of course, this depends on what the execution is doing). Is it just i/o stuff?

                          There is also a good explanation of all this here.

                          R Offline
                          R Offline
                          roofboard
                          wrote on last edited by
                          #11

                          @girish

                          At the end of the day, I found the culpret.
                          Also upgraded to a bigger server.

                          While yes N8N will happily crash it's self - I had a few perfmance bottlenecks and for now N8N seems to be happy with the traffic. Here is a breakdown of the solution without setting up queue mode.

                          1. N8N uses postgress - so bumping up the RAM for N8N is not enough that just grows the list of RAM eating active processes, you also have to go bump the RAM for Postgres
                          2. I am using Baserow for logging and followup task Queueing. By default baserow only has 3 Auth workers which is not enough to cover heavy load. So I had to install the CLI and run the command cloudron env set --app baserow.draglabs.com BASEROW_AMOUNT_OF_GUNICORN_WORKERS=9

                          Conclusion - Step 1 Significantly improved the performance of N8N dropping normal RAM consumption by about 30%
                          Step 2 Caused active processes to complete 10X faster further reducing N8N footprint.

                          Now that I upgraded to 24 gigs I am only using 8

                          H 1 Reply Last reply
                          3
                          • R roofboard

                            @girish

                            At the end of the day, I found the culpret.
                            Also upgraded to a bigger server.

                            While yes N8N will happily crash it's self - I had a few perfmance bottlenecks and for now N8N seems to be happy with the traffic. Here is a breakdown of the solution without setting up queue mode.

                            1. N8N uses postgress - so bumping up the RAM for N8N is not enough that just grows the list of RAM eating active processes, you also have to go bump the RAM for Postgres
                            2. I am using Baserow for logging and followup task Queueing. By default baserow only has 3 Auth workers which is not enough to cover heavy load. So I had to install the CLI and run the command cloudron env set --app baserow.draglabs.com BASEROW_AMOUNT_OF_GUNICORN_WORKERS=9

                            Conclusion - Step 1 Significantly improved the performance of N8N dropping normal RAM consumption by about 30%
                            Step 2 Caused active processes to complete 10X faster further reducing N8N footprint.

                            Now that I upgraded to 24 gigs I am only using 8

                            H Offline
                            H Offline
                            hugoo_souza10
                            wrote on last edited by
                            #12

                            @roofboard Hello how are you?
                            Could you tell me how you did the n8n queue mode installation? I've tried and I couldn't and I don't understand your explanation very well

                            girishG R 2 Replies Last reply
                            0
                            • H hugoo_souza10

                              @roofboard Hello how are you?
                              Could you tell me how you did the n8n queue mode installation? I've tried and I couldn't and I don't understand your explanation very well

                              girishG Offline
                              girishG Offline
                              girish
                              Staff
                              wrote on last edited by
                              #13

                              @hugoo_souza10 I think @roofboard enabled queuing in baserow and not in n8n.

                              What are you trying to do/solve ? Maybe you can open a separate thread with your issue.

                              H 1 Reply Last reply
                              1
                              • H hugoo_souza10

                                @roofboard Hello how are you?
                                Could you tell me how you did the n8n queue mode installation? I've tried and I couldn't and I don't understand your explanation very well

                                R Offline
                                R Offline
                                roofboard
                                wrote on last edited by
                                #14

                                @hugoo_souza10 yes that is accurate I increased the "gunicorn" workers in baserow allowing for more writes and reads. Essentially I never got queue mode working, but i did optimize the instance for maximum performance. It has a limit somewhere around 10 requests per second.

                                H 2 Replies Last reply
                                1
                                • girishG girish

                                  @hugoo_souza10 I think @roofboard enabled queuing in baserow and not in n8n.

                                  What are you trying to do/solve ? Maybe you can open a separate thread with your issue.

                                  H Offline
                                  H Offline
                                  hugoo_souza10
                                  wrote on last edited by
                                  #15

                                  @girish I wanted to see the simplest way to install the queue mode on the n8n, I've looked a lot and I don't find it. So, searching, I fell into this conversation.

                                  1 Reply Last reply
                                  0
                                  • R roofboard

                                    @hugoo_souza10 yes that is accurate I increased the "gunicorn" workers in baserow allowing for more writes and reads. Essentially I never got queue mode working, but i did optimize the instance for maximum performance. It has a limit somewhere around 10 requests per second.

                                    H Offline
                                    H Offline
                                    hugoo_souza10
                                    wrote on last edited by hugoo_souza10
                                    #16
                                    This post is deleted!
                                    1 Reply Last reply
                                    0
                                    • R roofboard

                                      @hugoo_souza10 yes that is accurate I increased the "gunicorn" workers in baserow allowing for more writes and reads. Essentially I never got queue mode working, but i did optimize the instance for maximum performance. It has a limit somewhere around 10 requests per second.

                                      H Offline
                                      H Offline
                                      hugoo_souza10
                                      wrote on last edited by
                                      #17

                                      @roofboard Can you explain to me how you did it? This would be just fantastic for escalating requests to people who have machines crashing.

                                      R 1 Reply Last reply
                                      0
                                      • H hugoo_souza10

                                        @roofboard Can you explain to me how you did it? This would be just fantastic for escalating requests to people who have machines crashing.

                                        R Offline
                                        R Offline
                                        roofboard
                                        wrote on last edited by
                                        #18

                                        @hugoo_souza10
                                        the matter of gunicorn workers is specific to baserow which I use for logging on N8N actions.

                                        to change the baserow env variables just go into the baserow terminal and type
                                        export BASEROW_AMOUNT_OF_GUNICORN_WORKERS=20

                                        that should do it.

                                        However for N8N the best you can do is give is 8gb or 16gb of ram, and increase the postgress ram to 4gb .

                                        Z 1 Reply Last reply
                                        1
                                        • R roofboard

                                          @hugoo_souza10
                                          the matter of gunicorn workers is specific to baserow which I use for logging on N8N actions.

                                          to change the baserow env variables just go into the baserow terminal and type
                                          export BASEROW_AMOUNT_OF_GUNICORN_WORKERS=20

                                          that should do it.

                                          However for N8N the best you can do is give is 8gb or 16gb of ram, and increase the postgress ram to 4gb .

                                          Z Offline
                                          Z Offline
                                          zonzonzon
                                          wrote on last edited by
                                          #19

                                          @roofboard How we can increase the postgress ram in cloudron ? Thank you.

                                          girishG 1 Reply Last reply
                                          1
                                          • Z zonzonzon

                                            @roofboard How we can increase the postgress ram in cloudron ? Thank you.

                                            girishG Offline
                                            girishG Offline
                                            girish
                                            Staff
                                            wrote on last edited by
                                            #20

                                            @zonzonzon Services view - https://docs.cloudron.io/services/#configure

                                            1 Reply Last reply
                                            1
                                            Reply
                                            • Reply as topic
                                            Log in to reply
                                            • Oldest to Newest
                                            • Newest to Oldest
                                            • Most Votes


                                              • Login

                                              • Don't have an account? Register

                                              • Login or register to search.
                                              • First post
                                                Last post
                                              0
                                              • Categories
                                              • Recent
                                              • Tags
                                              • Popular
                                              • Bookmarks
                                              • Search