eclipse-paho / eclipse-paho/paho.mqtt.java
Initiating new connections is slow
- Dominant language
- Java
- Stars
- 2.3k
- Forks
- 919
- PR merge metrics
- No merged PRs in 30d
Description
Please fill out the form below before submitting, thank you!
- [ ] Bug exists Release Version 1.2.0 ( Master Branch)
- [X] Bug exists in MQTTv3 Client on Snapshot Version 1.2.1-SNAPSHOT (Develop Branch)
Hi all,
I would like to highlight that Paho v1.2.1 seems to take quite a while to establish a single connection. I have only recently started using it in favour of the aging Fusesource MQTT client, but it seems to be considerably slower than v1.2.0 and the Fusesource MQTT client when it comes to establishing new connections.
I have only tried out the MQTTv3 client, as I am going through Apache Camel (which does not support a number of Paho's newer features). My project only requires MQTT v3 too.
My benchmark was the creation of 400 connections & subscribing to a topic each, through the creation of 400 Camel routes. Fusesource needed only about 8s, while Paho v1.2.0 needed about 9s. Starting from v1.2.1, it requires 140s to complete the same task.
I did a Wireshark capture and noted that there is a 250-300ms delay after the 3-way TCP handshake and the MQTT Connect command.
At first glance, it seemed to be a problem with Nagle, due to 892ec11. But commits up to right before 4b23f12 do not seem to exhibit the same delays. Perhaps 4b23f12 has something to do with this.
Thank you for your attention, and have a nice day.
Paho v1.2.0: [Imgur](https://i.imgur.com/NzpJ4MB.png)
Paho v1.2.1: [Imgur](https://i.imgur.com/HPJT2cN.png)
Contributor guide
Assessment
This issue has not been assessed yet.