-
Notifications
You must be signed in to change notification settings - Fork 220
Disable Nagle's algorithm on loopback sockets. #517
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
base: master
Are you sure you want to change the base?
Conversation
Sorry for the delay. Now the tests are fixed per #519. Would you mind rebasing this one please? |
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); |
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.
Do we have a rough evidence for this performance improvement? e.g., benchmark.
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.
And what's the impact of disabling this?
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.
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.
See issue 516.