Comparing the scalability of MQTT and WebSocket communication protocols using Amazon Web Services

University essay from KTH/Skolan för elektroteknik och datavetenskap (EECS)

Author: Marcus Werlinder; [2020]

Keywords: ;

Abstract: This study compares the scalability of two popular communication protocols within IoT, MQTT and WebSocket. The scalability comparison of the protocols is performed using a publish-subscribe pattern. EMQX is used to run the MQTT message broker, and Socket.IO is used for theWebSocket message broker. Five metrics are recorded; memory usage, network usage, CPU utilization, Round Trip Time (RTT) and message loss. The brokers are set in two different scenarios. The first scenario being many publishers and few subscribers, and the second scenario being many subscribers and few publishers. AWS EC2 is used to host the brokers, as well as the publishers and subscribers. The findings of this study indicate that WebSocket is best suited for memory usage and CPU utilization. MQTT is much better suited when it comes to network usage. MQTT and WebSocket has almost identical average RTT in the first scenario. However in the second scenario MQTT has an average RTT of 164 ms, compared to WebSocket that has an average RTT of 331 ms. Both communication protocols perform similar for message loss, whereWebSocket has zero dropped message, while  MQTT has a drop rate of only 0.001%.

  AT THIS PAGE YOU CAN DOWNLOAD THE WHOLE ESSAY. (follow the link to the next page)