-
Bug
-
Resolution: Done
-
None
-
None
-
None
-
Operating System: All
Platform: All
-
2914
TCP Basics - if you want to implement a command/reply protocol you have to set TCP_NODELAY.
This is doubly so when using Netty and abstractions on top of it which form the full command (or response) in one write buffer to write out. In such double-buffering environments the additional buffering in the kernel which happens when not setting NO_DELAY makes no sense and can only do harm in terms of latency.
References (I can probably start with TCP Illustrated here):
or
http://www.techrepublic.com/article/tcp-ip-options-for-high-performance-data-transmission/
and even the (reference) ssh implementation. Quoting from the source of openssh:
if (setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &opt, sizeof opt) == -1)
error("setsockopt TCP_NODELAY: %.100s", strerror(errno));
Patch to follow shortly.