[ros-dev] Loopback problem

Phillip Susi psusi at cfl.rr.com
Wed Dec 21 22:44:24 CET 2005

Joseph Galbraith wrote:
> If an app is going to send one byte at a time, disabling
> the nagle algorithm is _exactly_ the _wrong_ thing to do!
> The nagle algorithm exists precisely so that applications can
> send one byte at a time and not have sucky performance.

No, it exists to prevent such applications from flooding the network 
with a storm of small packets and causing congestion due to the 
increased overhead.  The loopback interface is not going to run into 
this problem so if you insist on sending small blocks of data and want 
them to go through fast, you want to turn off nagle.

> But any app that does:
>   send();
>   send();
>   .
>   .
>   .
>   send();
>   recv();
> Should not disable the nagel algorithm except in rare (I can't
> think of any) circumstances.

This is exactly one such case.  The app makes several sends but the 
total amount of data is less than one MSS, so nagle will cause delays. 
These delays hurt performance, and do not do any good when you are using 
the loopback interface.

If the app is sending a lot of data, just broken up into numerous small 
sends, then nagle will tend to increase the total throughput by lowering 
the overhead of sending numerous packets and should be left on, but in 
this case, the app is sending small amounts of data, but needs it to get 
there quickly, so it should be turned off.

More information about the Ros-dev mailing list