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

FramedTcp handling the nagle algorithm to improve the performance #77

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lemunozm
Copy link
Owner

@lemunozm lemunozm commented Apr 16, 2021

This PR handles the Nagle algorithm in FramedTcp allowing to send a message immediately without sending partially (whatever possible). In other words: it disabled the algorithm until the message is fully in the OS sending buffer, and then enables it to send the full message without waiting for another possible message.

This protocol is message-oriented. This means that receiving less than a message has no meaning for the receiver who needs to wait for the remaining data to produce a meaningful message (which implies allocating in a Decoder). For that reason, sending partial data before having the whole message does not improve anything. What's more, it saturates the network.

Although this feature implies a latency reduction since once the complete message is OS output buffer it is sent, could also imply an impact on the throughput. Anyway, the user of a FramedTcp transport would want latency versus throughput. If throughput is the target, they will probably send big messages that will be less impacted by this change, or even more probably they prefer to choose TCP transport that fits better for throughput.

NOTE: Conceptually it should work, but how to evaluate this improvement?

@lemunozm lemunozm force-pushed the framed-tcp-handle-nagle-algorithm branch from b5f464e to 9bf5d27 Compare April 16, 2021 12:29
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

Successfully merging this pull request may close these issues.

None yet

1 participant