Is there any performance stats vis-à-vis size of flows.json?
We have ~3500 nodes in flows .json - spanning multiple flows / subflows.
What we see is - once we do deploy - even if its deploy modified nodes - it takes significant time (more than few mins) for runtime to be available again.
During this period i can click inject - but nothing gets executed and once runtime is ready - all flows which i clicked - start.
While we are already actively checking where to prune out all not used / non active flows/nodes, wanted to check if anyone else faced such issues and if any suggestions.
and you can multiple the number of nodes in each subflow by the number of instances
e.g.
Main flow has 20 inject nodes and 20 subnode:my_big_subflow instances
subnode:my_big_subflowcontains 100 nodes
Total nodes = 20 injects 20 subflow instances + (20 * 100) = 2040 nodes to instanciate.
However, if you are not using context in subflows or just using them to tidy flows / hide implementation, they can pretty much be replaced with LINK-CALLs
That doesnt seem right - is that all node types or certain node types? and are you modifying a node inside a subflow or main flow?
Let me check this and come back. Will take some time to connect to that piece since its at work.
Agree. Did not think of that. So in actual the number of nodes (in memory / wher ever its stored) are much much more.
This is what i want to do eventually - esp since Dynamic Call is available with v3. I have significant dynamic calls. (i have raised a note regards this on Beta 3.2 topic).
I change nodes in both subflows and main flows. But let me do this - when i connect to work - let me run a test - and see if in both scenarios - the runtime takes same time to be available. I will come back.
I would certainly check the usual suspects such as exceeding your actual memory and therefore getting lots of paging - that will kill any performance. Also check whether it is Node-RED causing that or something else such as MongoDB.
Personally, I would also look to collapse some of the multiple-node flows into single function nodes.
If you enable trace level logging in the runtime you will get much more detailed information about starting/stopping individual nodes. With so many nodes that will be a lot of information, but it's also the best way to try to see where time is being spent.
I assume "2. Clicked Deploy Nodes" means you were in "Modified Nodes" deploy mode?
Since it deployed immediately but clicking inject took 8 minutes - there may be something else going on. Was the debug set to log to console? If so, do you see the new debug message in console immediately or after 8 minutes?
13 Jun 21:08:32 - [info] Node-RED version: v2.1.4
13 Jun 21:08:32 - [info] Node.js version: v16.13.2
...
...
13 Jun 21:08:57 - [trace] [flow:22d00a62550cbf2c] ------------------|--------------|-----------------
13 Jun 21:08:57 - [trace] [flow:5f762746ada88902] start flow [5f762746ada88902]
<run time was available at 21:14>
13 Jun 21:14:55 - [trace] runtime event: {"id":"runtime-state","retain":true}
13 Jun 21:14:55 - [info] Started flows
13 Jun 21:14:59 - [trace] comms.open /cfMhkppko/GRP7IpuafhhecY0N9f2+CxOK88rrju0s=
< I changed the position of a node and deployed.. following appears then>
13 Jun 21:20:08 - [trace] utils.writeFile - copied C:\ProgramData\node-red\flows.json TO C:\ProgramData\node-red.flows.json.backup
.....
.....
.....
13 Jun 21:20:08 - [trace] [flow:5f762746ada88902] start flow [5f762746ada88902]
13 Jun 21:26:05 - [trace] runtime event: {"id":"runtime-state","retain":true}
13 Jun 21:26:05 - [info] Started modified nodes
13 Jun 21:26:05 - [trace] runtime event: {"id":"runtime-deploy","payload":{"revision":"7d5d7c28857d69806fe298dd7d8f9e38"},"retain":true}
Runtime became available at 21:26.
My observations :
My inject + debug doesnt seem to reflect here. I ran it much after 21:26. And i don't see anything here. Do i need to do something special to log it. (Btw this instance is on 2.1.4).
5f762746ada88902 is an empty Flow 1. Probably the last flow in flows.json to be loaded by system.