Multiple instances of the same node into a flow

Hi all, I recently had a serious slowdown of NodeRed and I am investigating how to optimize the performance.
I have 8 flows and, to have them neatly arranged, I use groups to separate the nodes based on the task they perform.
Doing so, I often use multiple instances of the same node into these flows.
Just to make an example, I use multiple instances of the MQTT out node in the same flow and sometimes in the same group to avoid lot of wires going around and crossing nodes and other wires.
After this preamble, the question: is this a good practice or I have to avoid these multiple instances because they add load to the NodeRed engine?

Advanced thanks for sharing your knowledge and experience on this one

For an MQTT Out node, I use a singe one connected to a Link-In node. Then for any flows that require a connection that that MQTT node, I connect them with a Link-Out node. I find it helps to keep flows clean too.

For example, I have a single tab page for all Input and Output nodes (MQTT, Logging, etc) and everything just connects to them.

I also try to use a single flow for outputs: email, sms, mqtt etc with links to this flow from my other flows.

It makes the flow layout much tidier too, and if i were to suspect an mqtt loop it's easy to test by inserting a rate limit node between the link in and mqtt out nodes.

I don't do the same for mqtt inputs

I don't know but I suppose it's possible. I suspect minimal impact.
I'm sure that multiple mqtt broker config nodes would be bad.

As long as the mqtt nodes all use the same broker connection there would be negligible difference.

Actually there is only one broker configured and all the nodes refer to it.
I will give a try with the link nodes, even if, at first glance, it will be less evident where the outputs are going.
Thank you for the suggestions so far :smiley:

In that case I’d expect no difference. If anything multiple mqtt nodes would be notionally quicker, as adding link nodes is errr, just adding extra nodes in the path. ( but I doubt you could measure the difference)

1 Like

Alright, thank you so much. :wink:

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