run 64 nodes , cpu utilization becomes 100%

asked 2018-09-11 08:28:34 -0500

yan3x gravatar image

updated 2018-09-12 21:01:38 -0500

On the ROS2(Ardent) environment , when I start 32 Publisher nodes and 32 Subscriber nodes, CPU utilization becomes 100%.

As Publisher, I use the example code from

https://github.com/ros2/examples/blob...

As Subscriber, I use the example code from

https://github.com/ros2/examples/blob...

launched as follows

test.launch

from ros2run.api import get_executable_path

def launch(launch_descriptor, argv):
    ld = launch_descriptor

    for loop in range(32):
        ld.add_process(
            cmd=[get_executable_path(package_name='examples_rclcpp_minimal_subscriber', executable_name='subscriber_member_function')],
        )
        ld.add_process(
            cmd=[get_executable_path(package_name='examples_rclcpp_minimal_publisher', executable_name='publisher_member_function')],
        )

My emviromment

Operating System : Ubuntu 16.04

DDS implementation:FastRTPS

CPU : Intel core i3 (2.4GHz)

edit retag flag offensive close merge delete

Comments

Have you tried the same with the latest release Bouncy? Can you share your ready-to-user example to reproduce the problem?

Dirk Thomas gravatar image Dirk Thomas  ( 2018-09-11 10:34:08 -0500 )edit

What CPU are you running this on?

allenh1 gravatar image allenh1  ( 2018-09-11 18:28:30 -0500 )edit

Thomas

Sorry, I haven't tried on Bouncy yet.

Publisher and Subscriber source code is downloadable from Github example .

and just launched 32 subscriber_member_functions and 32 publisher_member_function.

yan3x gravatar image yan3x  ( 2018-09-12 03:46:39 -0500 )edit

Allen

CPU is Intel core i3 , 2,4GHz.

Operating System : Ubuntu 16.04

DDS implementation : FastRTPS

yan3x gravatar image yan3x  ( 2018-09-12 03:48:55 -0500 )edit
2

Please provide a working snippet (copy-n-pastable) to save time for everyone who volunteers to help.

Dirk Thomas gravatar image Dirk Thomas  ( 2018-09-12 10:39:05 -0500 )edit

The snippet still doesn't look complete. How do you run your launch file?

Dirk Thomas gravatar image Dirk Thomas  ( 2018-09-12 13:59:31 -0500 )edit

Please try the same without launch - running all the publishers and subscribers via ros2 run instead - to compare if the load is the same.

Dirk Thomas gravatar image Dirk Thomas  ( 2018-09-12 15:56:31 -0500 )edit

I've already test with ros2 run, and have a same result.

I 've done as follows

ros2 run examples_rclcpp_minimal_publisher publisher_member_function &

ros2 run examples_rclcpp_minimal_subscriber subscriber_member_function&

repeat these command 32 times.

yan3x gravatar image yan3x  ( 2018-09-12 21:04:39 -0500 )edit