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

Edwards, Shaun M. sedwards at swri.org
Thu Oct 13 18:02:35 UTC 2011


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).

-Shaun


________________________________
From: ros-users-bounces at code.ros.org [ros-users-bounces at code.ros.org] on behalf of Kim, Yoonsoo [yesarang.kim at gmail.com]
Sent: Wednesday, October 12, 2011 9:46 PM
To: User discussions
Subject: Re: [ros-users] Latency of subscriber callback for large amount of data

Thanks a lot!
It works!

- Yoonsoo

2011/10/13 Troy Straszheim <straszheim at willowgarage.com<mailto:straszheim at willowgarage.com>>
Thanks for the reproducable bug report... I get the same behavior, so
long as the packets are small enough.. above 10k or so I don't see
this behavior.  This looks like like Nagel's algorithm at work, try
setting TCP_NODELAY on the subscriber, like this:

#include <ros/transport_hints.h>
ros::Subscriber sub = n.subscribe("chatter", 1000, chatterCallback,

ros::TransportHints().tcpNoDelay());
_______________________________________________
ros-users mailing list
ros-users at code.ros.org<mailto:ros-users at code.ros.org>
https://code.ros.org/mailman/listinfo/ros-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ros.org/pipermail/ros-users/attachments/20111013/153141c8/attachment-0004.html>


More information about the ros-users mailing list