Best MQTT broker for throughput

2,750 views
Skip to first unread message

Andrea Giordano

unread,
Nov 3, 2017, 9:39:39 PM11/3/17
to MQTT
Hi,
I've installed a Mosquitto broker on a Raspberry Pi attracted by its simplicity.
On this one I have also a node-red server so I consume messages on mosquitto through it. 

The publishers are 16 scripts located in my laptop which sends 50 messages of 113 bytes per second to 16 topics on Mosquitto. On node-red I have 16 subscribers.
I noticed that using all the 16 scripts (so 800 messages per second and 90 KB/s of throughput) node-red displays the arriving data with a incredible slowness!!!
Moreover, the situation is gradually better as I reduce the running scripts.

I don't think the bottleneck is the raspberry is the bottleneck, it is connected with ethernet so... is it Mosquitto so weak?

Is there an MQTT broker (quite light since I have to install it on a Raspberry) adequate for me?


toast-uz

unread,
Nov 3, 2017, 10:57:00 PM11/3/17
to MQTT
Hi Andrea,

The performance of your scenario seemed to depend on the QoS of MQTT connection of node-red.
If the QoS was 1 or 2, your result was normal due to overhead of MQTT protocol.
To increase the performance, you can change the QoS to 0 or set max_inflight_messages 0 (unlimited) of mosquitto.conf.
Note this story is not related with QoS of publishers.

Regards,
Tatsuzo

2017年11月4日土曜日 10時39分39秒 UTC+9 Andrea Giordano:

Andrea Giordano

unread,
Nov 4, 2017, 12:18:36 PM11/4/17
to MQTT
thanks for your answer.
I already set max_inflight_messages to 0 while honestly I didn't understand how to set QoS to 0.

toast-uz

unread,
Nov 4, 2017, 8:12:22 PM11/4/17
to MQTT
According to my experience, max_inflight_messages 0 improved the performance under any QoS.
Back to the beginning, the important things for the performance are the QoS of publishers (= ?), the concurrency of publishers (= 16), the size of messages (= 113 bytes), the QoS of node-red (= ?),  and the configuration of mosquitto (= ?) in your scenario. Could you fill these missing information?

Andrea Giordano

unread,
Nov 6, 2017, 5:44:00 AM11/6/17
to MQTT
I set q0s of publishers to 0. 
The mosquitto.conf file is the following:

persistence false
connections_messages
true
max_inflight_messages
0
max_queued_messages
0
max_connections
-1

about QoS of node-red I have no information on it. I searched on google and official doc but I found no reference.
Anyway during a job I checked the top information. I noticed that mosquitto reaches at most the 20% of cpu usage while node-red touches 100%:since this one is a single core process probably it could be  the problem

Andrea Selva

unread,
Nov 6, 2017, 5:51:54 AM11/6/17
to mq...@googlegroups.com
Hi,
disclaimer: I'me the developer on Moquette MQTT

with Moquette on local machine i could reach ~30K messages per second in QoS0, but I know from various blogs that Moqsuitto could reach ~100K message per second

 Andrea

--
To learn more about MQTT please visit http://mqtt.org
---
You received this message because you are subscribed to the Google Groups "MQTT" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mqtt+unsubscribe@googlegroups.com.
To post to this group, send email to mq...@googlegroups.com.
Visit this group at https://groups.google.com/group/mqtt.
For more options, visit https://groups.google.com/d/optout.

toast-uz

unread,
Nov 6, 2017, 7:07:33 AM11/6/17
to MQTT
Generally, subscriber's QoS restricts up to publisher's QoS. Therefore, your QoS should be 0 which have no overhead.
Reply all
Reply to author
Forward
0 new messages