# Connection Speed Comparisons

**URL:** <https://discourse.nodered.org/t/connection-speed-comparisons/48282>\
**Category:** General\
**Created:** [12 July 2021 00:44 UTC](https://discourse.nodered.org/t/connection-speed-comparisons/48282 "2021-07-12T00:44:01Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![tmichaeltx](https://avatars.discourse-cdn.com/v4/letter/t/73ab20/32.png) [@tmichaeltx](https://discourse.nodered.org/u/tmichaeltx)\
**Post date:** [12 July 2021 00:44 UTC](https://discourse.nodered.org/t/connection-speed-comparisons/48282/1 "2021-07-12T00:44:01Z")

</div>

I have started using @Steve-Mcl 's excellent [flow-timer](https://flows.nodered.org/flow/63f29373e826a9fd4943d679d43e725f) in my development to compare various ways of doing things and found some interesting anecdata to share.

When comparing 3 ways of connecting 2 nodes, I found the following:

1. Connecting directly is consistently the fastest
2. Connecting via link out and link in nodes seems to add a consistent 1ms
3. Connecting via mqtt out and mqtt in nodes seems to add a fairly consistent 40-41ms.  
Here is a sample of may comparison looks like (updated image):  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/3/333cab5e500282affcb44f61836ac4a278daa7b5.png)

I doubt this matters in most applications, but I am trying to speed up my flows as much as possible to increase family acceptance of smarthome automation.

Just in case anyone is wondering about the setup, Node-Red and Mosquitto (MQTT server) are running in separate containers on a Synology NAS, so the IP connection between the 2 which is traversed twice probably isn't as bad as it might be if they were physically separate.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [12 July 2021 06:02 UTC](https://discourse.nodered.org/t/connection-speed-comparisons/48282/2 "2021-07-12T06:02:37Z")

</div>

What device is node red running on?  
What mqtt broker are you using?  
Where is the broker running?

---

<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:** [12 July 2021 09:05 UTC](https://discourse.nodered.org/t/connection-speed-comparisons/48282/3 "2021-07-12T09:05:25Z")

</div>

> [@tmichaeltx](#):
>
> Connecting directly is consistently the fastest

To be expected. No msg cloning etc.

> [@tmichaeltx](#):
>
> Connecting via link out and link in nodes seems to add a consistent 1ms

Sounds reasonable.

> [@tmichaeltx](#):
>
> Connecting via mqtt out and mqtt in nodes seems to add a fairly consistent 40-41ms

For a `localhost` mosquito - I get a fairly consistent 3~4ms  
For a local network mosquito - I get a replies anywhere from 6~40ms

---

<div class="post-metadata">

**Author:** ![Gunner](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gunner/32/43582_2.png) [@Gunner](https://discourse.nodered.org/u/Gunner)\
**Post date:** [12 July 2021 09:12 UTC](https://discourse.nodered.org/t/connection-speed-comparisons/48282/4 "2021-07-12T09:12:10Z")

</div>

> [@tmichaeltx](#):
>
> Connecting via link out and link in nodes seems to add a consistent 1ms

I prefer to see where all my spaghettis run anyhow 🍝 , so no need to loose that 1ms each 😜

> [@Colin](#):
>
> What device is node red running on?  
> What mqtt broker are you using?  
> Where is the broker running?

I thought that was already listed in the last paragraph? Besides this doesn't sound like an question needing a solution, more like a _"hey look what I found out"_ 😃

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [12 July 2021 12:46 UTC](https://discourse.nodered.org/t/connection-speed-comparisons/48282/5 "2021-07-12T12:46:44Z")

</div>

> [@Gunner](#):
>
> I thought that was already listed in the last paragraph

Strange, I didn't see that the first time. Probably operator error due to trying to reply on my phone.

---

<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:** [10 September 2021 12:47 UTC](https://discourse.nodered.org/t/connection-speed-comparisons/48282/6 "2021-09-10T12:47:23Z")

</div>

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