Size of flows.json and performance

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.

I did the test. Created inject + debug on tab / main flow. No subflows changes.

  1. Changed only the position of debug flag
  2. Clicked Deploy Nodes
  3. Deployed finished immediately
  4. I clicked inject.
  5. Took a good 8 minutes before result was reflected.

This is the usual behavior i am seeing off late.

Is there some trace or something which can help me investigate what the system is doing during those 8 mins ?

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 always do cpu profiling in those cases. See here for more info. Be aware that analysing the profiling result is not always easy...

Thank You Nick.
Is this the .."logging.{.. console {}}" setting in settings.js ?

Thank You Bart.
Let me check this.

Yes - you want to set logging.console.level to trace

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?

Thanks. Will do . Will come back. Work machine ... some of these changes take longer than needed.

Yes. That's the one.

That's the next step. Will come back.

better still, set the inject to repeat every 2 seconds - then check console after deploy.

Makes sense. Will do. Thanks Steve.

Hi All , i did the test.

  1. Change the settings.js to trace logging
  2. Restarted NR
  3. Starting message in console log

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] /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 :

  1. 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).
  2. 5f762746ada88902 is an empty Flow 1. Probably the last flow in flows.json to be loaded by system.

Not clear what system does for 6 mins.

Is your windows server behind a proxy or have no internet?

Is the debug set to output to system console?

Yes. Behind a proxy. No internet. Can this be the reason ?

This worked.
Now i see

< changed the position and clicked deploy >

13 Jun 21:58:14 - [trace] [flow:5f762746ada88902] start flow [5f762746ada88902]

< runtime became available >
13 Jun 22:05:15 - [trace] runtime event: {"id":"runtime-state","retain":true}

13 Jun 22:05:15 - [info] Started modified nodes
13 Jun 22:05:15 - [trace] runtime event: {"id":"runtime-deploy","payload":{"revision":"167d20e72d4f8206300d0340def8c3f4"},"retain":true}
13 Jun 22:05:15 - [info] [debug:4fb4329b2df72b1a]

< The above is from my debug message >


See here: Node-RED v0.19.4 3 minute delay during startup on windows - #15 by Steve-Mcl

Will try and update.

Good spot Steve.

I assume that delay only applies if you use the command, not if you start node-red using node.exe directly?

Yes, that start up delay, but I think there are other modules that might also end up calling out via npm (and therefore get hung up)

I would hope that all that would be done asynchronously so that it doesn't hold things up?

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