Git Product home page Git Product logo

Comments (13)

firesurfer avatar firesurfer commented on July 18, 2024

Hey,
is there already a fix available for this issue?
Can I somehow help fixing this issue?

from rclcpp.

dirk-thomas avatar dirk-thomas commented on July 18, 2024

@firesurfer I am not sure if the problem still exists or has been fixed already. If it would have been reported for the alpha1 I would have assumed it has been addressed by these (ros2/rmw_opensplice#60 ros2/rmw_connext#66). It would be great if you could create a simple example which demonstrates the problem.

from rclcpp.

firesurfer avatar firesurfer commented on July 18, 2024

I don't think that it is this specific problem. It seems more like that a huge number of created publishers/subscribers + services + parameterclients create a huge cpu load even if they are idle.
I'm trying to reproduce this phenomena in a simple example but can't get it to work at the moment.

By profiling my application with callgrind it seems that it spends most of the time in the rclcpp::executor::Executor::wait_for_work method called from the executor.
My application creates about 40 topics with about 30 publishers and 10 subscribers, about 40 parameter clients which access a single parameter service and 40 custom services. All of them are idle at the moment after creating them. Only the parameter clients are used once for accessing the central parameter service that runs in another process.

from rclcpp.

firesurfer avatar firesurfer commented on July 18, 2024

I found the problem. It depends on the interface the dds implementation chooses. In my case I had my application run on my laptop that is connected via wireless lan, but tried to create an example for demonstration on my desktop, which is connected via lan.

Nonetheless I find it a bit strange that using a wirelesslan connection results into a high cpu load.

from rclcpp.

dirk-thomas avatar dirk-thomas commented on July 18, 2024

We have just fixed another case where rclcpp would start busy looping (see ros2/rmw_opensplice#112). It would be great if you could try the latest versions from all repos and comment back if it helps for this case.

from rclcpp.

firesurfer avatar firesurfer commented on July 18, 2024

I pulled the latest version from the master branch. This issue is still existing, but I can't really test it because of the exception I mentioned in #193

from rclcpp.

firesurfer avatar firesurfer commented on July 18, 2024

By replacing the exception with a return I was able to test. The average cpu load in idle is much less than before. Around 20% on an older i7 cpu, same amount of publishers and so on as before.

But it doesn't seem to depend on whether I use a wireless or a wired connection anymore. In both cases I got the same cpu load.

from rclcpp.

dirk-thomas avatar dirk-thomas commented on July 18, 2024

While that sounds better 20% is still far away from idle. Can you either share an example which has that problem or debug locally to figure out where the CPU is being used in your case (at best using the debugger and identifying where it probably busy loops)?

from rclcpp.

firesurfer avatar firesurfer commented on July 18, 2024

I will try tomorrow tomorrow to recreate the scenario my application creates in an example. I hope this will help tracking down this issue and #192

from rclcpp.

firesurfer avatar firesurfer commented on July 18, 2024

Hi my example is in https://github.com/firesurfer/ros2_components_demo (the same example I already used for some other issues - please pull the newest version, I separated the ros2_components_demo and the ros2_components repo)

On my system opensplice dds automatically chooses wlan0.
The demo_client takes about 90% cpu time (meassured by htop)
the demo_server takes about 50 % cpu time
and the demo_parameter_server takes abot 2-3% cpu time
on a system running a Intel(R) Core(TM) i7-2670QM CPU @ 2.20GHz

from rclcpp.

dirk-thomas avatar dirk-thomas commented on July 18, 2024

@firesurfer Looking at the changes in your repo I assume this has been fixed in the meantime. Can this be closed?

from rclcpp.

firesurfer avatar firesurfer commented on July 18, 2024

Yes this is fixed and can be closed.

from rclcpp.

dirk-thomas avatar dirk-thomas commented on July 18, 2024

Thanks for confirming.

from rclcpp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.