Skip to content

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
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