Performance Evaluation of MQTT Communicationwith Heterogeneous Traffic
1st Ryohei Banno
Kogakuin UniversityTokyo, JAPANbanno@computer.org

Abstract—One of the protocols gaining popularity for Internetof Things (IoT) systems is MQTT. It is lightweight and has loose
coupling nature derived from the publish/subscribe communication model. The capability of handling heterogeneous data is
crucial in supporting cooperation among various applications andsensors. In this study, we evaluate the performance of MQTT
communication with the combination of different payload sizes.
Experimental result shows different tendencies of the hetero datacapability by broker products.
Index Terms—MQTT, Publish/subscribe, IoT

L2 switch

Publishers

Egress Subscribers
IngressBroker
throughput
throughput

LatencyFig. 1. Experimental environment

I. I NTRODUCTION
The Internet of Things (IoT) is rapidly expanding inmany industries, including smart factories and warehouses.
MQTT [1] is a suitable protocol for exchanging data in such
IoT systems. It is based on the publish/subscribe model [2] sothat it has loose coupling nature, i.e., it enables relationships
among devices and applications to vary flexibly.
To develop a large-scale IoT system, the performance ofan MQTT broker is a major concern. Since an MQTT broker
needs to handle all messages from publishers to subscribers,
it could be a bottleneck. Hence, clarifying the broker performance characteristics has been a practical topic, and various
existing studies evaluate MQTT brokers [3]–[7].
However, the existing studies do not adequately consider
heterogeneous traffic. IoT data is diversifying; evolving sensor
devices enable us to obtain high-quality data like 4k/8k
images, whereas some applications require small data suchas temperature at short intervals for real-time monitoring.
Considering an IoT platform for horizontal data integration
among various sensors and applications, an MQTT broker
could be a core component. Therefore, its performance forheterogeneous traffic should be clarified.
In this study, we evaluate multiple MQTT broker products
to clarify the performance characteristics for heterogeneous
traffic.
II. R ELATED WORK
There are existing studies aiming to confirm MQTT broker
performance. Mishra [7] conducted a fundamental evaluation
for both public brokers and locally deployed brokers. Ronzani
et al. [3] measured how distributed MQTT brokers can scale.
Bender et al. [4] built a test framework independent of MQTTThis work was supported by JST, PRESTO Grant Number JPMJPR21P8.

TABLE IM ACHINE INFORMATION
ItemCPU
MemoryNetworkOS

Specs
Core i9 10900K 3.7 GHz (10 cores, 20 threads)
64 GB
1 GbE
Ubuntu 20.04
TABLE IIS OFTWARE VERSIONSTypeBroker
ClientSoftware
Mosquitto
HiveMQ
VerneMQ
MQTTLoader

Version1.6.9
CE 2022.1
1.12.6.2
0.8.4

implementation and evaluated popular open-source implementations. Gemirter et al. [5] compared MQTT with AMQP andHTTP using a real-time smart city public data set. Different
from these studies, we focus on heterogeneous traffic.
III. E XPERIMENTAL CONFIGURATION
To conduct experiments, we use three servers, as shownin Figure 1 and Table I. As preliminary testing, we confirmedthat the round-trip-time by the ping command is 0.720 to 0.758
milliseconds, and the throughput by the iperf3 command is 913
to 926 Mbps among servers. We use three broker products,Mosquitto, HiveMQ, and VerneMQ, and a load-testing tool
MQTTLoader [8], as listed in Table II.
We set three kinds of configurations as follows:• Small data traffic: 1, 024 bytes payload size and up to200, 000 msg/sec ingress messages.
• Large data traffic: 20 Mbytes payload size and up to 10
msg/sec ingress messages.

Small data

Large data

Small data

Large data

Small data

Large data

Fig. 2. Throughput ratio with Mosquitto
Small data

Large data

05255075 100
CPU limitation [%]5255075 100
Egress75
CPU[%] 100
5 Ingress
25 limitation50
CPU limitation [%]Ingress
EgressIngress

Ratio
Ratio Ratio

00.500.500Large data

255075 100
CPU limitation [%]5255075 100
CPU[%] 100
Egress75
5 Ingress
25 limitation50
CPU limitation [%]Ingress
EgressIngress

EgressSmall-data throughput in homo-caseRatio of small-data throughput
to homogeneous case
Ratio of small-data throughput
case
Ratiotoofhomogeneous
small-data throughput
Ratio of large-data throughput
to homogeneous case
casedata
Fig. 5.to homogeneous
Latency for small
Ratio of large-data throughput
case
Ratiotoofhomogeneous
large-data throughput

Homogeneous

Small data
Small data

5255075 100
CPU limitation [%]5255075 100
CPU[%] 100
Egress75
5 Ingress
25 limitation50
CPU limitation [%]Ingress
EgressIngress
EgressHeterogeneous

to homogeneous case

Large data
Large data

10.5
10.5
00.500Homogeneous

HeterogeneousFig. 6. Latency for large data

Egress5255075 100
CPU limitation [%]5255075 100CPU[%] 100
Egress75
5 Ingress
25 limitation50
CPU limitation [%]Ingress
EgressIngress
EgressFig. 4. Throughput ratio with VerneMQ•Heterogeneous

Small-data throughput in hetero-case
Small-data throughput in homo-case
Small-data throughput in hetero-case
Small-datathroughput
throughputininhetero-casehomo-case
Small-data

51

10.5
1010.5
1

Smalldata
Large data
Fig.
3. Throughput ratio with HiveMQ

10.5
00.5

Homogeneous

Large data
Ratio
Ratio Ratio

Small data

Ratio
Ratio Ratio

Ratio
Ratio Ratio

Small data10.5
10

Heterogeneous

110.5
00.5

Homogeneous

Hetero data traffic: the combination of the above two.

In each of the small and large data configurations, the number of subscribers is five, where they compose a sharedsubscription group to receive messages in parallel. Hetero data
configuration combines these.
Regarding MQTT parameters, we set the protocol version
to 5.0, the QoS level to zero, and the retain flag to false. The
measurement metrics are ingress throughput, egress throughput, and latency from the publishers to the subscribers. Measurement time for each experiment is 70 seconds, including
five seconds ramp-up/ramp-down times.
IV. R ESULT AND DISCUSSION
We measured throughput with changing the available CPU
resource of brokers by the cpulimit command. Note that only
one core is enabled in this experiment. Figures 2, 3, and 4 show
how the average throughput of hetero data changes comparedto the homogeneous data cases, i.e., small and large data.
For example, in the case of Mosquitto with a five percent
CPU limitation, the small data ingress throughput is about 88
percent of the homogeneous small data case, whereas the large
data throughput is about 25 percent of the homogeneous large

data case. From these results, Mosquitto and HiveMQ tend to
suppress large data, whereas VerneMQ suppresses small data.
We also measured latency without the CPU resource limitation. We use the following ingress traffic patterns:• 10, 000 msg/sec small data & 1 msg/sec large data
• 40, 000 msg/sec small data & 2 msg/sec large data
• 83, 333 msg/sec small data & 4 msg/sec large data
Figures 5 and 6 show the results of latency for Mosquitto.
The average latency increases for both small and large datacompared to the homogeneous data cases.
V. C ONCLUSION
In this study, we conducted experiments to clarify thecharacteristics of MQTT brokers for heterogeneous traffic.
Future work includes additional experiments with practical IoT
traffic patterns and client configurations.
R EFERENCES[1] MQTT, https://mqtt.org/ (accessed Mar. 29, 2023).
[2] P. T. Eugster, P. A. Felber, R. Guerraoui, and A.-M. Kermarrec, “Themany faces of publish/subscribe,” ACM Computing Surveys, vol. 35, no. 2,pp. 114–131, 2003.
[3] D. Ronzani, C. E. Palazzi, and P. Manzoni, “Bringing mqtt brokers
to the edge: A preliminary evaluation,” in IEEE Annual Consumer
Communications and Networking Conference, 2022, pp. 695–698.
[4] M. Bender, E. Kirdan, M.-O. Pahl, and G. Carle, “Open-source mqttevaluation,” in IEEE Annual Consumer Communications and NetworkingConference, 2021, pp. 1–4.
[5] C. B. Gemirter, C. Senturca, and S. Baydere, “A comparative evaluationof amqp, mqtt and http protocols using real-time public smart city data,”
in International Conference on Computer Science and Engineering, 2021,
pp. 542–547.
[6] E. Gamess, T. N. Ford, and M. Trifas, “Performance evaluation of awidely used implementation of the mqtt protocol with large payloads innormal operation and under a dos attack,” in ACM Southeast Conference,
2021, p. 154–162.
[7] B. Mishra, “Performance evaluation of mqtt broker servers,” in International Conference on Computational Science and Its Applications, 2018,
pp. 599–609.
[8] R. Banno, K. Ohsawa, Y. Kitagawa, T. Takada, and T. Yoshizawa,“Measuring Performance of MQTT v5.0 Brokers with MQTTLoader,” inProc. IEEE Consumer Communications & Networking Conference, 2021,
pp. 1–2.