Closed FedorSmirnov89 closed 6 months ago
Changes Missing Coverage | Covered Lines | Changed/Added Lines | % | ||
---|---|---|---|---|---|
rumqttc/src/lib.rs | 1 | 4 | 25.0% | ||
<!-- | Total: | 2 | 5 | 40.0% | --> |
Files with Coverage Reduction | New Missed Lines | % | ||
---|---|---|---|---|
rumqttc/src/eventloop.rs | 1 | 83.91% | ||
<!-- | Total: | 1 | --> |
Totals | |
---|---|
Change from base Build 9193063302: | 0.001% |
Covered Lines: | 5977 |
Relevant Lines: | 16541 |
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
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 apt-get
in Linux) to set no-delay for the messages it is sending significantly reduced the jitter, we did the same thing on the client side by building our agents of a local branch of rumqttc
where we had the no-delay option enabled. Again, we saw a significant decrease in message jitter.
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
Checklist:
cargo fmt
CHANGELOG.md
if it's relevant to the users of the library. If it's not relevant mention why.