Hi all,
I am experiencing some behavior I cannot explain.
Here is what I do.
I am using the paho-c library and as a reference the paho python library. My Broker is mosquitto.
The goal of my experiments is to measure the application layer roundtrip time. Therefore I have the following setup
Application <----> Broker <---> Reflector
What I do is:
* I take the time in the application, put it into a packet and send it to the broker. (QoS 0) * The reflector is subscribed to theses messages, receives them, packs them into a new packet and sends the back to the broker using a different topic. * Finally I receive the message back at the application, take the current time and calculate the time difference between the current time and the time contained in the packet.
I have this implementation, both in C and in Python. All processes are running on the same machine.
No here are the observations that keep me busy.
If I watch the application delay for the c implementation I get something like 5, 1005, 106, 5, 1005, 104, 6 ...
For the python implementation it is like: 5, 5, 5, 6, 4, ....
You see the difference, unfortunately I need an implementation in C thanks to the target platform. I checked my code several times, there is nothing I could pinpoint to cause the delay.
To me, it resembles effects that I have seen in other projects when using TCP. Could it be, that somewhere in the library code there is some issue with the socket handling?
Any other ideas? Did I miss a configuration flag or something?
Cheers,
Chris
|