Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Paho » Paho: Latency/RTT of published Mqtt Messages(Measuring the latency (time from publish to reception by the broker) of Mqtt Messages)
Paho: Latency/RTT of published Mqtt Messages [message #1796545] Tue, 16 October 2018 00:42 Go to next message
Talha Ghaffar is currently offline Talha GhaffarFriend
Messages: 6
Registered: February 2017
Junior Member
Hi,

I intend to measure the latency of MQTT messages (time from publishing to reception by the broker).
I am using Paho's MqttAsyncClient with QoS 1 to publish the messages to Mosquitto broker.

My idea is to use save the message_id->timestamp mapping while sending the message and when PUBACK is received (QoS 1), use the message_id from PUBACK packet (IMqttDeliveryToken.getMessageId()) to get RTT [curr_time() - insert_time(message_id)].

I want opinion whether this method seems sound enough to measure this latency.

NOTE:
I already have the publisher to subscriber latency (using the timestamp in the payload with publisher's and subscriber's clocks synchronized). My goal is to get the breakdown of this pub-sub latency into pub-broker and broker-sub latency.

Thanks for your ideas and help.

[Updated on: Tue, 16 October 2018 00:43]

Report message to a moderator

Re: Paho: Latency/RTT of published Mqtt Messages [message #1796563 is a reply to message #1796545] Tue, 16 October 2018 07:58 Go to previous messageGo to next message
James Sutton is currently offline James SuttonFriend
Messages: 71
Registered: July 2015
Member
Hi,

That sounds about right to me, that will give you the time taken for your client to send the PUBLISH, which will then be accepted by the broker, and then the time taken for the PUBACK to be delivered to the client. Keep in mind that as you increase load on the client and / or broker, the latency may increase as messages are held in a queue.
Re: Paho: Latency/RTT of published Mqtt Messages [message #1796788 is a reply to message #1796563] Thu, 18 October 2018 22:59 Go to previous message
Talha Ghaffar is currently offline Talha GhaffarFriend
Messages: 6
Registered: February 2017
Junior Member
Thanks for responding!

Yes, I am observing this behavior of increased latency with increasing the load on the broker.

In your opinion, is the average latency obtained using this way [(publish-to-puback)/2 or RTT/2] a fair reflection of the publish latency in the context of an application?
For my case, this is much higher than the TCP latency (measured using qperf) between publisher and broker (or should it be pub-to-puback - tcpLat?).

Thanks!
Previous Topic:JSON Data from Paho mqtt client
Next Topic:Java Client
Goto Forum:
  


Current Time: Fri Oct 30 05:01:38 GMT 2020

Powered by FUDForum. Page generated in 0.15452 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top