bit-Tech
Vol. 8 No. 2 (2025): bit-Tech

Comparative Performance Analysis Between the MQTT and WebSocket Protocols

Muhammad Faishal Tsaqief (Universitas Teknologi Yogyakarta)
Joko Sutopo (Universitas Teknologi Yogyakarta)



Article Info

Publish Date
10 Dec 2025

Abstract

In the era of smart monitoring and real-time 3D visualization, communication delay remains a critical challenge for resource-constrained IoT devices. This study aims to determine which protocol MQTT or WebSocket delivers superior performance for real-time sensor data streaming in such latency-sensitive contexts. A controlled experimental setup was implemented using an ESP32-S3 microcontroller and an MPU-6050 inertial sensor, streaming 1,000 data samples per protocol to a Python-based server hosting a local Mosquitto MQTT broker. The evaluated performance metrics included mean latency, jitter (standard deviation of latency), and packet loss rate. Results indicate that under the tested LAN environment with a local broker, MQTT (using QoS level 0) significantly outperformed WebSocket. MQTT demonstrated substantially lower mean latency (11.040 ms vs. 41.544 ms), markedly reduced jitter (0.201 ms vs. 18.824 ms), and a superior packet loss rate (0.501% vs. 0.937%), showcasing exceptional stability and timing consistency for real-time data delivery. In contrast, WebSocket exhibited significantly higher latency and jitter, which would be detrimental to motion-sensitive applications. These findings challenge the common assumption favoring WebSocket for low-latency tasks and suggest that MQTT offers a more robust and suitable communication protocol for real-time 3D visualization on resource-constrained IoT devices within local network conditions. The superior performance of MQTT in this context provides a strong rationale for its adoption in edge computing-based visualization systems, where timing consistency is paramount.

Copyrights © 2025






Journal Info

Abbrev

bt

Publisher

Subject

Computer Science & IT

Description

The bit-Tech journal was developed with the aim of accommodating the scientific work of Lecturers and Students, both the results of scientific papers and research in the form of literature study results. It is hoped that this journal will increase the knowledge and exchange of scientific ...