# How many MQTT devices and publishes is too many

**URL:** https://discourse.nodered.org/t/how-many-mqtt-devices-and-publishes-is-too-many/22713
**Category:** General
**Created:** [6 March 2020 13:29 UTC](https://discourse.nodered.org/t/how-many-mqtt-devices-and-publishes-is-too-many/22713 "2020-03-06T13:29:45Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![SilasWesley](https://avatars.discourse-cdn.com/v4/letter/s/839c29/32.png) [@SilasWesley](https://discourse.nodered.org/u/SilasWesley)
#### Post date: [6 March 2020 13:29 UTC](https://discourse.nodered.org/t/how-many-mqtt-devices-and-publishes-is-too-many/22713/1 "2020-03-06T13:29:45Z")

</div>

So I have around 12 esp32's with relays and temperature sensors for my smart home. Each of them publishes the temperature to Node Red via MQTT every few seconds.

Could these be slowing down my network? Over the past months (as I've been amassing the esp's) my TP link has started to have degrading connection. Is MQTT in theory going to significantly slow a network or is it likely just how I'm implementing it?

---

<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: [6 March 2020 13:52 UTC](https://discourse.nodered.org/t/how-many-mqtt-devices-and-publishes-is-too-many/22713/2 "2020-03-06T13:52:20Z")

</div>

No, not at that rate. If you were publishing thousands a second then possibly.

---

<div class="post-metadata">

### Author: ![Christian-Me](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/christian-me/32/10774_2.png) [@Christian-Me](https://discourse.nodered.org/u/Christian-Me)
#### Post date: [6 March 2020 13:58 UTC](https://discourse.nodered.org/t/how-many-mqtt-devices-and-publishes-is-too-many/22713/3 "2020-03-06T13:58:18Z")

</div>

No, that’s why MQTT it is called “lightweight”  
But the frequency is a small Faktor. Even if I do not think that is a problem for every device you have always one open connection.

But perhaps you have a infinite loop? But even than that will slow down the client but not the network.

Use MQTT explorer and see how many messages are transferred over your broker.

---

<div class="post-metadata">

### Author: ![Christian-Me](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/christian-me/32/10774_2.png) [@Christian-Me](https://discourse.nodered.org/u/Christian-Me)
#### Post date: [6 March 2020 14:02 UTC](https://discourse.nodered.org/t/how-many-mqtt-devices-and-publishes-is-too-many/22713/4 "2020-03-06T14:02:59Z")

</div>

Updates every few seconds only shows you the noise of the sensor and no other benefit. I oversample the readings over on minute on the esp and only send this value. That gives a stable noise free data stream.  
Good to detect temp changes on a finer level without being misled by the sensor noise.

---

<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: [6 March 2020 14:20 UTC](https://discourse.nodered.org/t/how-many-mqtt-devices-and-publishes-is-too-many/22713/5 "2020-03-06T14:20:38Z")

</div>

> [@Christian-Me](#):
>
> Updates every few seconds only shows you the noise of the sensor and no other benefit.

That depends what you are measuring. For room temperature you are correct, but if you try to control, for example, radiator temperature (heated by flowing hot water) then the temperature can change dramatically over just a few seconds.

---

<div class="post-metadata">

### Author: ![Christian-Me](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/christian-me/32/10774_2.png) [@Christian-Me](https://discourse.nodered.org/u/Christian-Me)
#### Post date: [6 March 2020 15:19 UTC](https://discourse.nodered.org/t/how-many-mqtt-devices-and-publishes-is-too-many/22713/6 "2020-03-06T15:19:30Z")

</div>

You are right. That raises the question if interval updates on a somehow fixed frequency makes sense  
An example. My garden irrigation system has a pump, two pressure sensors before and after a filter and a flow sensor. Most of the time there is nothing to chat about (only state messages everything is fine)  
But when it comes into action frequent measurements are interesting.  
Or my thermostats. They only send a update on relevant changes (0.2C) to keep the sending limit (duty cycle) on the 868khz Band)  
So we have beefy dual core ESPs (or I still think ESP8266 are sufficient for most of HA tasks) so let them do more then stupid reporting on a fixed interval filling up databases or travel trough the hole network and nodes to be trashed at the end (or absolutely invisible on a dashboard node slowing everything down in some way)

Data (acquisition) is cheap processing and intelligent (?) decision making not.

---

<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: [6 March 2020 16:47 UTC](https://discourse.nodered.org/t/how-many-mqtt-devices-and-publishes-is-too-many/22713/7 "2020-03-06T16:47:53Z")

</div>

> [@Christian-Me](#):
>
> That raises the question if interval updates on a somehow fixed frequency makes sense

No definitely not fixed the same for the whole system. Update rates should be set for each parameter based on the requirements for that measurement. Sometimes that does mean fetching data for some parameters more frequently than is necessary because it may not be practical to fetch some parameter from a device without fetching other parameters at the same time. In that case the unneeded samples should be dropped before being, for example, saved in a database.

---

<div class="post-metadata">

### Author: ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)
#### Post date: [6 March 2020 18:06 UTC](https://discourse.nodered.org/t/how-many-mqtt-devices-and-publishes-is-too-many/22713/8 "2020-03-06T18:06:18Z")

</div>

> [@SilasWesley](#):
>
> my TP link has started to have degrading connection.

LAN should not be impacted by some packets from 12 ESP's. Try wireshark and be amazed how much data is being transferred continously over a network.

But perhaps you mean the 2.4Ghz band, as it could be saturated.

---

<div class="post-metadata">

### Author: ![hominidae](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hominidae/32/4174_2.png) [@hominidae](https://discourse.nodered.org/u/hominidae)
#### Post date: [6 March 2020 22:30 UTC](https://discourse.nodered.org/t/how-many-mqtt-devices-and-publishes-is-too-many/22713/9 "2020-03-06T22:30:42Z")

</div>

how many clients are there in total?  
Most standard SoHo routers are limited in the number of wireless clients supported.  
This is not a matter of bandwidth but simply the number of concurrent connections...you should examine the clients, how often they actually need to re-establish the link.

Edit: see here: [https://groups.google.com/d/msg/sonoffusers/9PJnwo0SGD0/XLsIW1pFAQAJ](https://groups.google.com/d/msg/sonoffusers/9PJnwo0SGD0/XLsIW1pFAQAJ)

---

<div class="post-metadata">

### Author: ![kuema](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/kuema/32/6542_2.png) [@kuema](https://discourse.nodered.org/u/kuema)
#### Post date: [12 March 2020 18:33 UTC](https://discourse.nodered.org/t/how-many-mqtt-devices-and-publishes-is-too-many/22713/10 "2020-03-12T18:33:25Z")

</div>

This topic has been part of a series of recent forum spams, so closing this one.
