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

long connection latency when setting up multiple mqtt connections #1430

Open
zhen9910 opened this issue Dec 11, 2023 · 0 comments
Open

long connection latency when setting up multiple mqtt connections #1430

zhen9910 opened this issue Dec 11, 2023 · 0 comments

Comments

@zhen9910
Copy link

zhen9910 commented Dec 11, 2023

Description:
When setting up multiple connections using paho.mqtt.c library, the first connection is able to be set up very fast, about 200ms; but all the other connections are connected very slow, about 2s.

I first experienced this performance issue using paho.mqtt.rust v 0.12. eclipse/paho.mqtt.rust#217
As paho.mqtt.rust is a wrapper around paho.mqtt.c library, I can also reproduce this same perforamance issue using paho.mqtt.c.

So I want to ask if this is a known constraint or something that can be improved?

Reproduce:
This can be reproduced using attached sample code with paho-mqtt3a on Linux ubuntu 20.04.
mqtt_sample.txt

Log:

./build/mqtt_sample
====== Creating MQTT client ======
====== creating MQTT connect ======
====== Successful connection ====== 
====== Connect Time elpased is 204 ms ======

====== Creating MQTT client ======
====== creating MQTT connect ======
====== Successful connection ====== 
====== Connect Time elpased is 2105 ms ======

====== Creating MQTT client ======
====== creating MQTT connect ======
====== Successful connection ====== 
====== Connect Time elpased is 2106 ms ======

Trace:
Attached in trace.txt

trace.txt

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

1 participant