-
Notifications
You must be signed in to change notification settings - Fork 268
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
Option to configure TCP no_delay #872
Option to configure TCP no_delay #872
Conversation
This extension allows users to specify whether the `nodelay` flag is set for the TCP connection from the MQTT client to the broker. This flag can help reduce latency by disabling Nagle's algorithm, which is beneficial in scenarios requiring minimal delay. Signed off: FedorSmirnov89 Issue: bytebeamio#871
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few suggestions...
Co-authored-by: Devdutt Shenoi <devdutt@outlook.in>
Pull Request Test Coverage Report for Build 9258539470Details
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR look good, thanks for the contribution!
just one question before merging:
have you tried comparing the actual performance difference with & without this flag? because if latency is bottle-necked by eventloop or some other thing, this might not be that boost right? please correct me if wrong
thanks :)
I believe OP is trying to use rumqttc in time critical applications where the messages they are trying to send aren't enough for nagling to be the right approach. We can safely provide this as an opt-in. |
Congrats on the merge @FedorSmirnov89 🎊 |
Thank you for merging :) . Just to add the information @swanandx was asking about: It's exactly as @de-sh said: We have a distributed application where two clients on different nodes exchange messages. We measured the timing of the messages since we want them to have as little latency and jitter as possible. They are exchanging very small messages on a high frequency (range of 1-4 ms). Seeing that configuring the broker (we are using the normal Mosquitto which comes with an Thanks a lot for reviewing and merging :) . We can now go back again to building off the main branch of the repository which is great 😄 |
NetworkOptions
by an optionalnodelay
flagnodelay
Type of change
Description
This pull request adds an option to set the nodelay flag for the TCP connection in the MQTT client. The nodelay flag, when enabled, disables Nagle's algorithm, which can help reduce latency by sending packets immediately without waiting for a full buffer. This is particularly useful in scenarios where low latency is critical.
Changes
Issue
tcp-nodelay
flag used for the connection from the MQTT client to the broker #871Checklist:
cargo fmt
CHANGELOG.md
if it's relevant to the users of the library. If it's not relevant mention why.