From node redis docs:
socket_nodelay: defaults to true. Whether to call setNoDelay() on the
TCP stream, which disables the Nagle algorithm on the underlying
socket. Setting this option to false can result in additional
throughput at the cost of more latency. Most applications will want
this set to true.
Why would I want to turn off Nagle’s algorithm?
You would want to turn off the Nagle Algorithm when you’re concerned about latency. My understanding of the algorithm is that it delays sending data until there is a reasonable amount to send. This in turn reduces the protocol overhead of the stream because more data is sent in a single packet (i.e. with a single header).
With the Nagle Algorithm turned off, the idea is that data is sent immediately by the protocol stack.
It was designed in the day when network resources were more constrained and so reducing the overhead was more important that expedient delivery. However these days with generally faster interconnects and more requirement for low-latency it’s become less important. (Think video streaming!)