Comments (15)
The SQLite plugin is not optimized as of now - rosbag2 still lacks a good performance testing suite to check for bottlenecks. Since no transactions are used as of today in the database backend, I would expect performance to be really bad for many small messages and better for larger messages at lower numbers.
Sending around 100 MB of data per second could be too much already on some systems.
from rosbag2.
@MCP-TTC we indeed fixed a memory leak recently in #502. It's yet to be backported and released in the next Foxy patch release.
As of now, you could try to compile rosbag2 in an overlay workspace with this PR: #518
from rosbag2.
@Karsten1987 I confirm you it works, no more memory leaks. Thanks.
I have a question for you and the community ofc, still about performances, if I record the following topics:
- image1 (like the above) 20Hz
- pcl2 100Hz
- imu 125Hz
- image2 (1/3 of image1 payload) 30Hz
in a single bag instance I notice a big drop of the small but high frequency messages (delta freq. > 40%).
in multiple bag instances (1 per topic for example) the recorded messages frequencies are almost the produced ones (delta freq. = ~4%).
Did anyone ever notice something like this?
PS: the SSD drive can reach the required write bandwidth
from rosbag2.
I'm going to close this issue for now, please reopen if there is anything specific to address.
from rosbag2.
Hi,
have you managed to solve this?
I am facing the same issue on ros galactic version. I use the python rosbag tool to convert the euroc mav dataset from ros1 to ros2. And while in ros1 I get that the imu topic is at 200Hz, at ros2 I get that the imu topic is at 120Hz.
from rosbag2.
Hmm, looks like we have to dig a bit deeper into performance optimizations for SQLite3. The assumption that it's more suited for larger data seems to be in conflict with this ros-answers question: https://answers.ros.org/question/328814/ros2-bag-issue/
@Martin-Idel Do you know of any good starting point for diving into these performance topics?
from rosbag2.
I wanted to come back to this issue, because I find it interesting. I think the first step would be to create a good performance test suite to be sure that any changes actually help.
My starting point would probably be https://stackoverflow.com/questions/1711631/improve-insert-per-second-performance-of-sqlite - as you can see there are quite some points to get started. From what I know the actual performance tuning will probably start with:
- Use transactions (this will definitely help, and it might help a lot)
- Use batching within transactions (larger changes required here, but this will help for small messages)
- Look into journal modes (might also require more user settings)
from rosbag2.
Hi,
I am facing a similar problem with the following configuration:
- 2xImage msg @~11FPS 1928x1208x4
- 1xPointCloud2 msg @~11FPS 900pts
- sqlite plugin
- Ubuntu 18.04
- USB3.0 External SSD (tested up to 480MB/s)
- default DDS
Here some results:
- ROS2 nodes + rosbag2 from ROS2
- topic_img_1 - 4.707FPS
- topic_img_2 - 4.709FPS
- topic_pts - 4.689FPS
- ROS2 nodes + ros1_bridge + rosbag from ROS1
- topic_img_1 - 1.524FPS
- topic_img_2 - 3.352FPS
- topic_pts - 2.972FPS
- ROS1 nodes + rosbagv2 from ROS1
- topic_img_1 - 11.256FPS
- topic_img_2 - 11.250FPS
- topic_pts - 11.116FPS
Any idea on how to improve rosbag2 performances?
Did anyone find a solution, even a temporary one, for this issue?
from rosbag2.
I tried the following setup with Eloquent and Foxy on Ubuntu 18.04, both built from source:
- publish 1920x600 images at 20 FPS with image_tools::cam2image (burger mode)
ros2 run image_tools cam2image --ros-args -p burger_mode:=true -p width:=1920 -p height:=600 -p frequency:=20.0
- record the topic /image splitting the bag every 2GB
ros2 bag record -o test-bag -b 2000000000 /image
With Eloquent everything seems fine but with Foxy the recording process continuously allocates memory up to a memory overflow if not stopped. I am wondering if there is any memory leak or if anyone else is getting the same issue.
from rosbag2.
That behavior is probably related to #436 - the queue can fill up and drop messages while rosbag2 is writing
from rosbag2.
@Karsten1987 @adamdbrw With the recent work done for performance in rosbag2, do you think we should close out this issue?
from rosbag2.
I think so, this was one of the background issues for our work and things improved a lot
from rosbag2.
I am OK with closing this but I had no way to test the relative improvements yet. Have those been already merged to the Foxy branch? To me it seems the new improvements are only available on the Rolling one.
Am I wrong?
from rosbag2.
The improvements are merged into the master branch (which is available as a Rolling package). It is my opinion that doing the feature development on the latest branch meets the requirements of an enhancement ticket - there is no given expectation that a new feature is backported to all live distributions. If a backport is desired for specific features, that can be tracked via a separate follow-up ticket.
For discussion about backporting latest features to Foxy, also see https://discourse.ros.org/t/fast-forward-merging-rosbag2-master-api-to-foxy/18927
from rosbag2.
I have a pointcloud2 dataset recorded with ros1. I converted it to ros2 bag using the rosbags tool. When I try to play the bag file, the RAM consumption ramps up and my system starts lagging. I tried to read the bag file with a custom python script using rosbag2_py and things seem to work without any issues. There is no memory outage. Can anyone please let me know whether this is a known issue with ros2 bag?
from rosbag2.
Related Issues (20)
- Play folder of ROS2 bags in sequential order or let them be fed as input arguments. HOT 3
- All bags being opened when playing back multiple bag files. HOT 4
- Find typesupport libraries in LD_LIBRARY_PATH HOT 1
- TimeControllerClock::sleep_until(some_time_in_the_past) sleeps too long HOT 5
- Can't play bags with v9 metadata HOT 2
- Qos question HOT 2
- Capture implicit message definitions for action feedback messages HOT 1
- `Recording stopped` message is duplicated when stop recording HOT 2
- How to read a mcap file and publish data using cpp? HOT 4
- Use mcap storage compression when compression is requested HOT 8
- Early (incorrect) exit in certain situations with mcap logging HOT 19
- rosbag2_transport::Recorder duration 0 HOT 2
- [FEA] Support distributed recording to get ultra high performance. HOT 3
- Subscribers to topics don't record data. HOT 2
- Use topic_id instead of topic_name in inner rosbag2 buffers and data structures HOT 9
- Add play --exclude option for humble HOT 2
- ros-humble-zstd-vendor have old version for libzstd library and this is used by systemd HOT 3
- Failed to seek rosbag2 HOT 3
- Docker- No storage id specified, and no plugin found that could open URI HOT 5
- Record a limited number of messages on each topic HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rosbag2.