Closed vpoughonEZ closed 1 year ago
Did you also try this with tcp_nodelay=True
?
http://wiki.ros.org/rospy/Overview/Publishers%20and%20Subscribers
Yes, thank you. It appears to fix the problem when used on the Subscriber. It has no effect when used on the Publisher. I did not know about Nagle's algorithm, very interesting!
Can this issue be closed?
Yes for me it's ok, thanks.
The script below, when run inside the
ros:noetic-ros-core-buster
docker image, is running very slowly for some message sizes. The run time as a function of message size in bytes (the script first argument) is:After some testing, it seems related to the network interface MTU size. The default MTU size of the localhost interface is 65536, and the upper threshold of the problem is 65466 which leaves a few bytes for headers.
Changing the MTU size with for example
ip link set dev lo mtu 1500
changes the runtime of the script as a function of the message size, and indicates that the problem occurs when the message size is below the MTU (but above some mimum value around ~500).