Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

High latency on multi-process simple pub/sub with DYNAMIC_REUSABLE #782

Open
mauropasse opened this issue Oct 2, 2024 · 0 comments
Open

Comments

@mauropasse
Copy link
Contributor

mauropasse commented Oct 2, 2024

On rolling, I'm seeing high latency when using DYNAMIC_REUSABLE as history memory policy & zero copy.
In the other hand, latency seems OK when using PREALLOCATED_WITH_REALLOC.
Also latency seems OK when the system is single-process, regardless of the policy (still using loaned msgs).

The system tested uses shared memory to pass a 4MB loaned message between processes:

Multi-process system:
- Process 1: Publisher of 4Mb Loaned messages (10Hz)
- Process 2: Subscription of 4Mb messages
- Platforms: x86 & RaspberryPi4

As reference I'm also showing latency of IPC OFF, i.e. not using Loaned messages with shared memory (normal serialized msg).

Below I provide a CPU flamegraph (from RPi) for both policies:

  • Left: DYNAMIC_REUSABLE

    • There seem to be a copy of the 4Mb message on eprosima::fastdds::rtps::UDPChannelResource::perform_listen_operation.
  • Right: PREALLOCATED_WITH_REALLOC

The XML config file looks like this for both reader & writer:

  <qos><data_sharing><kind>AUTOMATIC</kind></data_sharing></qos>
  <historyMemoryPolicy>DYNAMIC_REUSABLE</historyMemoryPolicy>
  <!-- other: PREALLOCATED_WITH_REALLOC -->

Since in this case we're aiming for zero-copy using shared memory with loaned messages, I'm guessing this copy is undesired, i.e. a bug? What do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant