[ros-users] Latency of subscriber callback for large amount of data

Troy Straszheim straszheim at willowgarage.com
Thu Oct 13 18:52:01 UTC 2011


On Thu, Oct 13, 2011 at 11:02 AM, Edwards, Shaun M. <sedwards at swri.org> wrote:
> Troy,
>
> I have ran into this same problem many times when working with sockets.  Is
> there a reason not to turn off the nagel algorithm by default.  Turning off
> the Nagel algorithm would seem to be the default behavior for small
> messages.  This would result in more network traffic, but this is probably
> what is desired (i.e. messages arriving as they are sent, instead of
> buffered).

A reasonable question.  Maybe it would have been a good decision to
turn it off by default initially (i.e. a few years ago) or not....
but at this point I'd be very reluctant to subtly change the behavior
of every subscriber in ROSland.  Imagine the consternation when pipes
that used to exchange lots of small messages efficiently,  suddenly
start to use 2x more bandwidth than they used to.

Of course enabling TCP_NODELAY doesn't guarantee you anything.  If you
really absolutely need to process things at 100Hz you'd be doing
things completely differently (i.e. realtime kernel and whatnot).

-t



More information about the ros-users mailing list