Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MQTT vs HTTP ? #8

Open
martin9115 opened this issue Jan 15, 2022 · 5 comments
Open

MQTT vs HTTP ? #8

martin9115 opened this issue Jan 15, 2022 · 5 comments

Comments

@martin9115
Copy link

Hi, is there a performance test between MQTT vs HTTP ?

@francois-normandin
Copy link

It is undeniably faster to transfer payloads using MQTT, but both protocols serve different purposes. MQTT is for data payloads and a pub-sub architecture, whereas HTTP is suited for synchronous query and response.

MQTT's effective transfer rate will slow down when you introduce quality of service > 0, but fundamentally the difference lies in the size of the header required for a successful transfer. MQTT's header is always the same size (publish packet format) whereas HTTP's is significant larger and can vary based on signatures, authorization types and encoding.

If you want a benchmark, I'm afraid it will be hard to decouple your type of payload from the expected result. In theory, compare the size of headers and that's your difference in throughput.

Here's a light read on the topic:

https://medium.com/mqtt-buddy/mqtt-vs-http-which-one-is-the-best-for-iot-c868169b3105

@martin9115
Copy link
Author

Can i just testing time to transfer certain amount of data ?

@francois-normandin
Copy link

Of course.

What I'm saying is that such a benchmark will represent how fast is your transfer based on the type of payload you have to ferry around, not a universal benchmark for MQTT vs HTTP.

@martin9115
Copy link
Author

Is there any example, that can i use ? Is Labview support MQTT-SN ?

@francois-normandin
Copy link

Example: not that I know of. Be sure to factor in the latency to the server you are using when you write your code. Better make sure the servers (MQTT and HTTP) are both on the same machine, so that network latency is somewhat the same.

I don't know of any library that supports MQTT-SN in LabVIEW. MQTT-SN is limited subset of MQTT (ID instead of topic name) to create even smaller payloads, at the price of interoperability. Unless you are planning to develop your own MQTT-SN server, you can probably get by encoding directly into byte arrays for the simplest of nodes. At that point, it is little more than a direct TCP/UDP connection...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants