Having a lot of mqtt (out)nodes in my flows (must sound familiar), I was wondering if there is a best practice / best optimisation of (mqtt) node use.
Is there a performance impact/optimisation of using a lot of mqtt out nodes versus using a single mqtt-out node that are all linked using link nodes ?
I guess it does not apply only to mqtt, but in general, is there a degrade/gain to reuse single out-nodes via links nodes ?
Adding the link nodes does mean the message has to go through more 'hops' between nodes before it gets published. But I doubt you'd notice the difference to be honest.
From a memory standpoint, if you are replacing N MQTT nodes with 1 MQTT node, but adding in (N+1) Link nodes, then overall you will have more node objects in the flow. Again, I doubt whether that is a difference you'd be able to measure unless you are doing things at a pretty massive scale.
It is important that all the nodes use the same mqtt config node. But I have little doubt you have done that already. Worth saying though for others that may see this.
@colin Why? what is the reason?
Since the broker connection is kept open and shared between all user nodes it wouldn't make much of a difference, since all messages have to be handled in the same NodeJS process anyway.
What could have an impact is the usage of wildcards vs. distinct topics (on a larger scale).
Each config node represents a separate connection to the broker.
if you want to maximise efficiency, use the same config node so you only have one connection to the broker.
Sorry I should have mentioned that, but yes I assumed a single config.
Just in case there is some confusion over terminology when you create an MQTT In/Out node there are actually two nodes involved. The In/Out node that you see on the flow and the config node that it uses to connect to the mqtt broker. On the In/Out node configuration is a drop down box to select the server (ie broker), each broker maps to a config node. So in the dropdown there should generally only be one entry for each MQTT broker that you wish to connect to,
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.