-
Notifications
You must be signed in to change notification settings - Fork 0
Cherry-pick: Add option to force TCP_QUICKACK. #1
base: cardano-sl-0.4
Are you sure you want to change the base?
Conversation
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.
5e0dd61
to
83aa874
Compare
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 | |||
} |
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.
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?
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.