Insanly huge agent cpu spike

Open
#190 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
cpp, docker

Research direction

Start by running the provided Docker command on the reported Ubuntu 20.04 and ROS 2 Foxy setup with eight ESP32 clients, then monitor htop during the Publisher example. Reproduce the delayed CPU growth and connection loss, identify the agent behavior responsible, and verify that CPU usage remains stable while all clients continue publishing.

Written by the indexing model from the issue text.

Description

Describe the bug
Hi,
I am encountering huge CPU usage of the Micro ros agent running from docker as follows:
docker run -it --rm -v /dev:/dev --privileged --net=host microros/micro-ros-agent:foxy udp4 -p 8888
MicrosoftTeams-image (23)

To Reproduce
Steps to reproduce the behaviour:

  1. Clone repo 'micro_ros_arduino' Foxy Branch
  2. Flash 8 ESPs with it (Client Key unique for each Esp)
  3. Run Publisher example for 3 hours
  4. CPU spike happens after around 3h
  5. See CPU spike on htop

Expected behaviour
A normal usage of ~100% CPU usage max at all times.

System information (please complete the following information):

  • OS: Ubuntu 20.04
  • ROS 2 Foxy
  • Hardware: 8x ESP32 micro-controllers running agent and client version 2.3.0

what can be the possible reason behind such a huge CPU usage?
Observation from my tests: it happens exponentially were it starts to increase to 200 then 500 then 1000%
And after the agent reaches past 200%, the Esp32 loses connection with the agent and fails to publish any messages.
Any help is much appreciated!

Dominant language
C++
Stars
201
Forks
111
Avg merge
1d 6h
Merged PRs (30d)
10

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from micro-ROS/micro-ROS-Agent

All issues in micro-ROS/micro-ROS-Agent

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.