Re: [ros-users] ROS cpu load

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Cedric Pradalier
Date:  
To: ros-users
Subject: Re: [ros-users] ROS cpu load
On 08/01/10 00:13, Ken Conley wrote:
> Thanks for the great analysis.


cProfile is actually a pretty good tools to analyse this kind of thing,
and trivial to run on the python scripts:
http://docs.python.org/library/profile.html

I also used oprofile for the C++ nodes, but this was not so practical
with mostly-sleeping processes (so I add to let it run for a long time).

> I've updated pmon.py (r10575), as I agree that that loop can run
> slower. What was the CPU usage before that?


Around 5%. This is not much, but I considered it was too much given that
the system was sitting idle, with just roscore started.

>
> You previously mentioned getting some numbers on rospy -- I'd love to
> know if you see any issues there or not, even if you don't have time
> to track down more fast loops. AFAIK, the main problem with rospy is
> that Python gobbles up memory when you use threads, and rospy is a bit
> too greedy in this regard. The hope is to redo the threading model in
> a future rewrite, but it's good to understand the current issues when
> prioritizing.


I looked a bit for rospy, and could not identify exactly where we're
losing time. I have one process where I'm publishing 40 bytes messages
at 30 fps, and the cpu load significantly increase as soon as we send to
a remote host, from 1-2% if listening locally, to 7-10% when listening
remotely. I need to investigate further and I'll let you know.

Cheers

--
Dr. Cedric Pradalier
http://www.asl.ethz.ch/people/cedricp