Closed nh2 closed 1 month ago
Python 3.6 made TCP_NODELAY
the default for asyncio
: https://bugs.python.org/issue27456
Thank you for your patience! The change has been made and is now part of network-transport-tcp 0.8.4, released today.
@LaurentRDC Thanks!
network-transport-tcp has
tcpNoDelay = False
by default.Enabling Nagle's algorithm (not setting
TCP_NODELAY
) is not appropriate for cases where many multithreaded users multiplex over a single TCP connection, as is done in network-transport-tcp.As described on e.g. https://eklitzke.org/the-caveats-of-tcp-nodelay:
By now I have seen many performance issues caused by this in real-world uses of network-transport-tcp, e.g.
spawn
calls per second even on localhost netowrkingcardano-sl
In my opinion, network-transport-tcp by design needs
TCP_NODELAY
because it is multiplexing, and thus the actual senders and receivers have no control over in what interleaving messages are sent and received.Further, it already uses
sendMany
where possible to combine as much data as possible into a singlesend
, so the additional kernel-space batching performed by Nagle's algorithm does not add much on top (apart from the dreaded 40 ms send delay).