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

Disable Nagle's algorithm on loopback sockets. #517

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

trohwer
Copy link

@trohwer trohwer commented Apr 25, 2023

See issue 516.

@HyukjinKwon
Copy link
Member

Sorry for the delay. Now the tests are fixed per #519. Would you mind rebasing this one please?

@trohwer
Copy link
Author

trohwer commented Mar 22, 2024

Hello, I merged the main branch. Is it ok now?

@@ -74,6 +74,10 @@ public ClientServerConnection(Gateway gateway, Socket socket, List<Class<? exten
throws IOException {
super();
this.socket = socket;

// disable Nagle's algorithm on loopback connection to avoid performance issues due to write,write,read situations
if (socket.getLocalAddress().isLoopbackAddress()) socket.setTcpNoDelay(true);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have a rough evidence for this performance improvement? e.g., benchmark.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And what's the impact of disabling this?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See #516 for background and a measurement for a slow case. For the loopback interface I would assume, there are no negative performance impacts for disabling Nagle. I would have assumed it to be the default on loopback, but that seems not to be always the case.

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

2 participants