Why should someone turn off the Nagle algorithm?

From node redis docs :

socket_nodelay: the default value is true. Call setNoDelay () on TCP, which disables the Nagle-based connector algorithm. Setting this parameter to false can lead to additional throughput due to a longer delay. Most applications will want this value to be true.

Why do I want to disable the Nagle algorithm?

+4
source share
1 answer

You want to disable the Nagle Algorithm when you are concerned about the delay. My understanding of the algorithm is that it delays sending data until there is a sufficient amount to send. This, in turn, reduces the flow protocol overhead as more data is sent in one packet (i.e., with one header).

When the Nagle algorithm is disabled, the idea is that data is immediately sent to the protocol stack.

It was developed on the day when network resources were more limited, and therefore reducing overhead was more important than expedient delivery. However, these days with faster interconnects and a greater need for low latency, it is becoming less important. (Think streaming video!)

+9
source

Source: https://habr.com/ru/post/1400349/


All Articles