How to write configuration file to reduce CPU usage while multi participants are used. #3287
Replies: 2 comments 6 replies
-
I think multicast may lead to CPU consumed for receiving UDP message. <?xml version="1.0" encoding="UTF-8" ?>
<profiles xmlns="http://www.eprosima.com/XMLSchemas/fastRTPS_Profiles">
<participant profile_name="name_is_mandatory" is_default_profile="true">
<rtps>
<builtin>
<metatrafficUnicastLocatorList>
<locator/>
</metatrafficUnicastLocatorList>
<initialPeersList>
<locator>
<udpv4>
<address>192.168.0.122</address>
</udpv4>
</locator>
</initialPeersList>
</builtin>
</rtps>
</participant>
</profiles> IP address will be changed to IP address of host and RasPi 4 board. If I not use built-in transport like the below, I can add <?xml version="1.0" encoding="UTF-8" ?>
<profiles xmlns="http://www.eprosima.com/XMLSchemas/fastRTPS_Profiles">
<transport_descriptors>
<transport_descriptor>
<transport_id>udp_transport</transport_id>
<type>UDPv4</type>
<sendBufferSize>9216</sendBufferSize>
<receiveBufferSize>9216</receiveBufferSize>
<maxMessageSize>9216</maxMessageSize>
<non_blocking_send>true</non_blocking_send>
<maxInitialPeersRange>100</maxInitialPeersRange>
</transport_descriptor>
</transport_descriptors>
<participant profile_name="name_is_mandatory" is_default_profile="true">
<rtps>
<!--
<userTransports>
<transport_id>udp_transport</transport_id>
</userTransports>
<useBuiltinTransports>false</useBuiltinTransports>
-->
<builtin>
<metatrafficUnicastLocatorList>
<locator/>
</metatrafficUnicastLocatorList>
<initialPeersList>
<locator>
<udpv4>
<address>192.168.0.122</address>
</udpv4>
</locator>
</initialPeersList>
</builtin>
</rtps>
</participant>
</profiles> But if I use built-in transport, how to set |
Beta Was this translation helpful? Give feedback.
-
Hi @Barry-Xu-2018, Thanks for the detailed description. |
Beta Was this translation helpful? Give feedback.
-
Is there an already existing issue for this?
Expected behavior
Low CPU usage while no message is sent.
Current behavior
On my environment, while the number of participant is more than 50, CPU usage is close to 60%.
Steps to reproduce
Example codes:
Repository: https://github.com/Barry-Xu-2018/dds_multi_pub_multi_sub.git
Branch: multi-participant
Each participant create one publisher or subscriber, and each publisher/subscriber create 10 datawriters/datareaders.
After all connection are established (No message will be sent), get CPU usage.
Publisher are on Host. 10 means how many participants will be created.
Subscriber are on RasPi 4 board. 10 means how many participants will be created.
After all connection are established, you will see
+++ All subscriptions connect publishers ! +++
.And check CPU usage on RasPi 4 board as the below
(Note: there are 4 cores in RasPi 4. So the maximum CPU usage is 400%)
Fast DDS version/commit
v2.9.0
Platform/Architecture
Ubuntu Focal 20.04 arm64
Transport layer
Default configuration, UDPv4 & SHM
Additional context
I use
perf
to analyze CPU usage.According to perf result, CPU consumption is at 2 points.
XML configuration file
No response
Relevant log output
No response
Network traffic capture
No response
Beta Was this translation helpful? Give feedback.
All reactions