Skip to content
This repository has been archived by the owner on Mar 11, 2020. It is now read-only.

Cherry-pick: Add option to force TCP_QUICKACK. #1

Open
wants to merge 1 commit into
base: cardano-sl-0.4
Choose a base branch
from

Conversation

nh2
Copy link

@nh2 nh2 commented May 5, 2017

It is well known that Nagle's algorithm (the absence of TCP_NODELAY)
and delayed acknowledgements (the absence of TCP_QUICKACK) cause
performance issues on TCP; see for example:

TCP_NODELAY was already implemented; this commit adds TCP_QUICKACK.

This change breaks the external API, because socketToEndPoint
(for reasons not obvious to me) takes all socket options as individual
arguments, instead of as a settings object.

@nh2
Copy link
Author

nh2 commented May 5, 2017

Upstream PR: haskell-distributed#67

It is well known that Nagle's algorithm (the absence of TCP_NODELAY)
and delayed acknowledgements (the absence of TCP_QUICKACK) cause
performance issues on TCP; see for example:

* https://eklitzke.org/the-caveats-of-tcp-nodelay
* http://jvns.ca/blog/2015/11/21/why-you-should-understand-a-little-about-tcp/

TCP_NODELAY was already implemented; this commit adds TCP_QUICKACK.

This change breaks the external API, because `socketToEndPoint`
(for reasons not obvious to me) takes all socket options as individual
arguments, instead of as a settings object.
@nh2 nh2 changed the base branch from cardano-sl-0.4 to cardano-sl-0.4-tcp-quickacks-setting May 5, 2017 14:30
@nh2 nh2 changed the base branch from cardano-sl-0.4-tcp-quickacks-setting to cardano-sl-0.4 May 5, 2017 14:31
@nh2 nh2 force-pushed the csl-0.4-tcp-quickacks-setting branch from 5e0dd61 to 83aa874 Compare May 5, 2017 14:33
@avieth
Copy link

avieth commented May 5, 2017

This change breaks the external API, because socketToEndPoint
(for reasons not obvious to me) takes all socket options as individual
arguments, instead of as a settings object.

Feel free to correct this! I'm sure it would be warmly welcomed upstream.

@nh2
Copy link
Author

nh2 commented May 5, 2017

Feel free to correct this! I'm sure it would be warmly welcomed upstream.

OK, I've just asked on haskell-distributed#67 (comment)

@@ -1129,6 +1155,10 @@ handleIncomingMessages params (ourEndPoint, theirEndPoint) = do
Left err -> prematureExit err
Right sock -> tryIO (go sock) >>= either prematureExit return
where
settings = defaultTCPInternalSettings
{ tcpInternalForceQuickAck = tcpForceQuickAck params
}
Copy link

Choose a reason for hiding this comment

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

I suggest we put a field transportInternalSettings into TCPTransport and create it once at createTransport time.

Or, how about moving TCPParameters into Network.Transport.TCP.Internal, and doing away with TCPInternalSettings completely?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants