You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am getting some high max latencies in the ping-pong example with large messages.
When I tried 1MB messages, the median case is only a millisecond or two. But occasionally my worst-case timing is on the order of a hundred milliseconds.
Should I try and tweak my environment or is this expected?
Should I try and tweak my environment or is this expected?
I'd say it depends. I've double checked on my laptop (macOS) over loopback and I get times between (roughly) 2ms and 5ms. As the README shows, on two Ubuntu boxes over GbE it varies between 9ms and 10ms (from the raw data referenced by the README).
If you are on Linux and using loopback, I would guess the latency spikes are related to packet loss and retransmits. One way that can happen is if the 1MB samples occasionally overflow the UDP socket receive buffer. The default configuration of Cyclone (this) requests a 1MB buffer for these, but the default kernel limits are lower and so in a default-default configuration on Ubuntu 18.04 you'll end up with 425984 bytes. A bit of a delay in scheduling the thread reading from the socket can then easily cause an overflow.
To see what you buffer size you actually have, try this: CYCLONEDDS_URI='<Tracing><Verbosity>config</><OutputFile>stdout' bin/ddsperf pong, for me it says failed to increase socket receive buffer size to 1048576 bytes, continuing with 425984 bytes. You can raise the kernel limit pretty easily.
Certainly if Linux is running in a VM, those numbers you get are perfectly in line with what I get running that same test on Ubuntu inside a VM on macOS with the default configuration of everything.
Note that this is really very system dependent: macOS will happily give it the 1MB it asks for, and I think Windows does, too. And it turns out the machines I used for the GbE test have larger UDP buffers configured ... guess I need to update the system configuration details for the benchmark data in the README ...
And as a side note: do consider using ddsperf instead of the roundtrip and throughput examples. The output is a bit messier, but it includes a lot more information 🙂.
I also got the message failed to increase socket receive buffer size to 1048576 bytes, continuing with 425984 bytes in my log. I followed that link, raised my max buffer size, and now my max latencies aren't crazy outliers anymore.
I ran this on two computers with ubuntu 18.04 running loopback, no VMs, both needed their buffer size expanded.
Activity
eboasson commentedon Oct 25, 2019
Hi @Jconn,
I'd say it depends. I've double checked on my laptop (macOS) over loopback and I get times between (roughly) 2ms and 5ms. As the README shows, on two Ubuntu boxes over GbE it varies between 9ms and 10ms (from the raw data referenced by the README).
If you are on Linux and using loopback, I would guess the latency spikes are related to packet loss and retransmits. One way that can happen is if the 1MB samples occasionally overflow the UDP socket receive buffer. The default configuration of Cyclone (this) requests a 1MB buffer for these, but the default kernel limits are lower and so in a default-default configuration on Ubuntu 18.04 you'll end up with 425984 bytes. A bit of a delay in scheduling the thread reading from the socket can then easily cause an overflow.
To see what you buffer size you actually have, try this:
CYCLONEDDS_URI='<Tracing><Verbosity>config</><OutputFile>stdout' bin/ddsperf pong, for me it saysfailed to increase socket receive buffer size to 1048576 bytes, continuing with 425984 bytes. You can raise the kernel limit pretty easily.Certainly if Linux is running in a VM, those numbers you get are perfectly in line with what I get running that same test on Ubuntu inside a VM on macOS with the default configuration of everything.
Note that this is really very system dependent: macOS will happily give it the 1MB it asks for, and I think Windows does, too. And it turns out the machines I used for the GbE test have larger UDP buffers configured ... guess I need to update the system configuration details for the benchmark data in the README ...
And as a side note: do consider using
ddsperfinstead of the roundtrip and throughput examples. The output is a bit messier, but it includes a lot more information 🙂.Jconn commentedon Oct 25, 2019
@eboasson great answer, thank you.
I also got the message
failed to increase socket receive buffer size to 1048576 bytes, continuing with 425984 bytesin my log. I followed that link, raised my max buffer size, and now my max latencies aren't crazy outliers anymore.I ran this on two computers with ubuntu 18.04 running loopback, no VMs, both needed their buffer size expanded.
Add rmw_publisher_wait_for_all_acked support (eclipse-cyclonedds#294)