# NR flows update very slow when \>\> 500 flows

**URL:** <https://discourse.nodered.org/t/nr-flows-update-very-slow-when-500-flows/87687>\
**Category:** General\
**Created:** [3 May 2024 12:50 UTC](https://discourse.nodered.org/t/nr-flows-update-very-slow-when-500-flows/87687 "2024-05-03T12:50:28Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dunken](https://avatars.discourse-cdn.com/v4/letter/d/45deac/32.png) [@Dunken](https://discourse.nodered.org/u/Dunken)\
**Post date:** [3 May 2024 12:50 UTC](https://discourse.nodered.org/t/nr-flows-update-very-slow-when-500-flows/87687/1 "2024-05-03T12:50:28Z")

</div>

On a test Node-RED instance we face very slow update-time when we want to update a single flow (we tried /flows and /flow/:id APIs). The deployment of a single flow takes up to 20-30 seconds.

We currently have roughly 700 flows deployed (just a few nodes each). Is this expected? Can this somehow be improved?

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [3 May 2024 12:55 UTC](https://discourse.nodered.org/t/nr-flows-update-very-slow-when-500-flows/87687/2 "2024-05-03T12:55:05Z")

</div>

Have you tried selecting modified nodes or flows from deply dropdown.

 ![Screenshot_20240503-135301](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/b/bbcb63bcdb72880c352cfe61f1cb302c7cca213e.png)  
Then when you press deploy only modified nodes or flows are deployed.  
Or have i miss read your post and you want to use the admin API?

---

<div class="post-metadata">

**Author:** ![Dunken](https://avatars.discourse-cdn.com/v4/letter/d/45deac/32.png) [@Dunken](https://discourse.nodered.org/u/Dunken)\
**Post date:** [3 May 2024 13:08 UTC](https://discourse.nodered.org/t/nr-flows-update-very-slow-when-500-flows/87687/3 "2024-05-03T13:08:41Z")

</div>

Yes, we hide all flows but one (which one is provide during startup of Node-RED UI) and deploy this single flow only (in order to achieve this we slightly customized NR).

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [3 May 2024 13:42 UTC](https://discourse.nodered.org/t/nr-flows-update-very-slow-when-500-flows/87687/4 "2024-05-03T13:42:41Z")

</div>

> [@Dunken](#):
>
> hide all flows but one

Hidding flow tabs does not affect what is posted.

Can you answer explicitly if you are using the "modified nodes" option as shown in @E1cid screen shot (the deploy button "modified nodes" option)

---

<div class="post-metadata">

**Author:** ![Dunken](https://avatars.discourse-cdn.com/v4/letter/d/45deac/32.png) [@Dunken](https://discourse.nodered.org/u/Dunken)\
**Post date:** [3 May 2024 13:59 UTC](https://discourse.nodered.org/t/nr-flows-update-very-slow-when-500-flows/87687/5 "2024-05-03T13:59:01Z")

</div>

We allow only "Modified Flow". When I check the API call I see:

method: POST  
url: /flows  
headers: Node-Red-Api-Version: v2; Node-Red-Deployment-Single-Flow: [UUID]; Node-Red-Deployment-Type: flows

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [3 May 2024 14:04 UTC](https://discourse.nodered.org/t/nr-flows-update-very-slow-when-500-flows/87687/6 "2024-05-03T14:04:22Z")

</div>

> [@Dunken](#):
>
> We allow only "Modified Flow". When I check the API call I see:

And what if you use "Modified Nodes" mode?

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/8/488376bea5e493aa85ea341f0c8c2be8f8efaaf8.png)

> [@Dunken](#):
>
> 700 flows deployed (just a few nodes each).

Is that 700 tabs with a few nodes on each?

Are you using subflows? And if yes:

- when you make your changes, are you making changes to subflow internals or regular flows?
- how many subflows do you have
- how many instances of subflows do you have?
- typically, how many nodes inside your subflows?

Has the slow down only just started happening (i.e. did you recently add flows or install a contrib node)?

---

<div class="post-metadata">

**Author:** ![Dunken](https://avatars.discourse-cdn.com/v4/letter/d/45deac/32.png) [@Dunken](https://discourse.nodered.org/u/Dunken)\
**Post date:** [3 May 2024 14:09 UTC](https://discourse.nodered.org/t/nr-flows-update-very-slow-when-500-flows/87687/7 "2024-05-03T14:09:41Z")

</div>

> And what if you use "Modified Nodes" mode?

This option we removed (I would have to test it... can I do it via API)?

> Is that 700 tabs with a few nodes on each?

Yes (would be 700 tabs but we hide all but one during a session).

> are you making changes to subflow internals or regular flows

Regular Flows. We don't use subflows.

> Has the slow down only just started happening (i.e. did you recently add flows or install a contrib node)?

The more flows the slower. We just noticed it recently when we created (cloned) flows for testing purposes.

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [3 May 2024 14:19 UTC](https://discourse.nodered.org/t/nr-flows-update-very-slow-when-500-flows/87687/8 "2024-05-03T14:19:24Z")

</div>

> [@Dunken](#):
>
> > Is that 700 tabs with a few nodes on each?
> 
> Yes (would be 700 tabs but we hide all but one during a session).

Again, that makes zero difference.

Modified flows reinitialises "all connected nodes" (those that connect via a wire).

The deploy oprtation ALWAYS sends FULL FLOW JSON, its the bit under the hood that changes:

- Full Deploy destroys and recreates everything (connections are terminated, instances are destroyed, then all recreated)
- "Modified Nodes" destroys recreates everything connected to a modified node (by a regular wire, not a dotted link wire)
- "Modified Nodes" destroys recreates only nodes that were changed (and that must be a property change. x/y position doesnt count)

> [@Dunken](#):
>
> > And what if you use "Modified Nodes" mode?
> 
> This option we removed (I would have to test it... can I do it via API)?

Yes, change "Deployment-Type" header as per the docs

* * *

Why do you have 700 flows with only a small amount of nodes on each tab? That is a LOT of overhead for little reason as far as I can see. Perhaps it is time to scale horizontally?

---

<div class="post-metadata">

**Author:** ![Dunken](https://avatars.discourse-cdn.com/v4/letter/d/45deac/32.png) [@Dunken](https://discourse.nodered.org/u/Dunken)\
**Post date:** [3 May 2024 14:28 UTC](https://discourse.nodered.org/t/nr-flows-update-very-slow-when-500-flows/87687/9 "2024-05-03T14:28:53Z")

</div>

Thanks Steve!

> Again, that makes zero difference.

I understand, I just wanted to explain why we don't care about the 700 (which might seem a lot).

> Modified flows reinitialises "all connected nodes" (those that connect via a wire).

As the flow is always a single flow this part would be fine I guess... however, we also noticed that always the full json is posted.

> Why do you have 700 flows with only a small amount of nodes on each tab?

Because a user is only interested in one or a few flows out of the 700... we only want to show one flow at a time...

> That is a LOT of overhead for little reason as far as I can see. Perhaps it is time to scale horizontally?

How would you solve it with less overhead? I don't get this... Regarding scaling horizontally... you mean to say we should use more than one Node-RED instance? Actually I believe this is coming up soon, yes. However, as you might imagine this than rather complex (auto scale-out and scale-in would be expected...).

---

<div class="post-metadata">

**Author:** ![craigcurtin](https://avatars.discourse-cdn.com/v4/letter/c/94ad74/32.png) [@craigcurtin](https://discourse.nodered.org/u/craigcurtin)\
**Post date:** [6 May 2024 01:32 UTC](https://discourse.nodered.org/t/nr-flows-update-very-slow-when-500-flows/87687/10 "2024-05-06T01:32:20Z")

</div>

You have not mentioned what hardware you are throwing at this - which could make a difference

I also recall someone else recently had a massive number of flows and was having problems with deployments - ended up being some orphaned config nodes that were point to incorrect/obsolete external servers if i remember correctly

Have you checked your config nodes to make sure they are all valid ?

Craig

---

<div class="post-metadata">

**Author:** ![xx\_Nexus\_xx](https://avatars.discourse-cdn.com/v4/letter/x/54ee81/32.png) [@xx\_Nexus\_xx](https://discourse.nodered.org/u/xx_Nexus_xx)\
**Post date:** [6 May 2024 06:17 UTC](https://discourse.nodered.org/t/nr-flows-update-very-slow-when-500-flows/87687/11 "2024-05-06T06:17:41Z")

</div>

I had a same "sluggish" behavior of Node-Red during development tasks .. I had a lot of flows (less 200) and a lot of global and local vairables.

I'm running Docker Node-Red and have laptop for development using Chrome. The Node-Red on docker is barely using any resources (~10-20 on average, 50% peak)

I just upgraded my 8GB laptop to 16gb memory and now everything is smooth again 😉

---

<div class="post-metadata">

**Author:** ![Dunken](https://avatars.discourse-cdn.com/v4/letter/d/45deac/32.png) [@Dunken](https://discourse.nodered.org/u/Dunken)\
**Post date:** [6 May 2024 09:46 UTC](https://discourse.nodered.org/t/nr-flows-update-very-slow-when-500-flows/87687/12 "2024-05-06T09:46:56Z")

</div>

We run on AWS ECS Fargate: 1vCPU und 30GB RAM.

Config Nodes are all valid. Thanks for the hint though.

---

<div class="post-metadata">

**Author:** ![Dunken](https://avatars.discourse-cdn.com/v4/letter/d/45deac/32.png) [@Dunken](https://discourse.nodered.org/u/Dunken)\
**Post date:** [6 May 2024 09:47 UTC](https://discourse.nodered.org/t/nr-flows-update-very-slow-when-500-flows/87687/13 "2024-05-06T09:47:48Z")

</div>

If I check CPU and RAM consumption during design time it's very low.

---

<div class="post-metadata">

**Author:** ![craigcurtin](https://avatars.discourse-cdn.com/v4/letter/c/94ad74/32.png) [@craigcurtin](https://discourse.nodered.org/u/craigcurtin)\
**Post date:** [6 May 2024 23:48 UTC](https://discourse.nodered.org/t/nr-flows-update-very-slow-when-500-flows/87687/14 "2024-05-06T23:48:11Z")

</div>

WHat about I/O CPU and RAM during Deploy - i.e. where is the bottleneck as far as AWS is concerned ?

Managing 700 flows is a bit of a nightmare - i would definitely look at scaling horizontally with more instances and divide the flows logically amongst them

With 700 flows there could be any manner of crap hanging around in one of the flows and you would have no idea without stepping through each of them one at a time, remove the flow and try a deploy, rinse and repeat

I assume the slowdown has just happened recently or has it been a gradual thing ?

Craig

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [4 August 2024 23:49 UTC](https://discourse.nodered.org/t/nr-flows-update-very-slow-when-500-flows/87687/15 "2024-08-04T23:49:10Z")

</div>

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