Skip to content

Set TCP_NODELAY #1122

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

Merged
merged 1 commit into from
Nov 22, 2024
Merged

Set TCP_NODELAY #1122

merged 1 commit into from
Nov 22, 2024

Conversation

robsdedude
Copy link
Member

This yields a small performance improvement by disabling Nagle's algorithm on the TCP sockets.

The change only affects the synchronous driver as most async runtime implementations already set this socket option for us.

@robsdedude robsdedude marked this pull request as ready for review November 21, 2024 09:16
@@ -548,6 +551,12 @@ def _connect(cls, resolved_address, timeout, keep_alive):
s = socket(AF_INET6)
else:
raise ValueError(f"Unsupported address {resolved_address!r}")
try:
Copy link
Contributor

Choose a reason for hiding this comment

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

If the exception is raised does that surface to the user or get logged and the driver continues to operate using Nagels algorithm?

Copy link
Member Author

Choose a reason for hiding this comment

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

The intention is that we do this on a best-effort basis. If the socket option is not available (i.e., exception is being raised), we'll just ignore it and do what we were doing before this change.

Copy link
Contributor

@AndyHeap-NeoTech AndyHeap-NeoTech left a comment

Choose a reason for hiding this comment

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

LGTM

@robsdedude robsdedude merged commit 6551e92 into neo4j:5.0 Nov 22, 2024
20 checks passed
@robsdedude robsdedude deleted the tcp-nodelay branch November 22, 2024 14:09
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.

2 participants