|
Package Summary
Tags | No category tags. |
Version | 0.15.12 |
License | Apache License 2.0 |
Build type | AMENT_CMAKE |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/ros2/rosbag2.git |
VCS Type | git |
VCS Version | humble |
Last Updated | 2024-11-06 |
Dev Status | DEVELOPED |
CI status | No Continuous Integration |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Michael Orlov
- Geoffrey Biggs
- Michel Hidalgo
- Adam Dabrowski
Authors
Rosbag2 writer benchmarking
The primary package to test performance of the rosbag2.
How it works
Use benchmark_launch.py
launchfile to run an entire set of benchmarks.
Launchfile requires two arguments:
-
benchmark
- provides benchmark description (how many repetitions, cache size, database configuration etc.), -
producers
- provides producers description (how many publisher/producer instances, frequency, messages size etc.)
Templates for these configuration files are in config
directory of this package.
To run test benchmark (with test.yaml
and mixed_110Mbs.yaml
):
ros2 launch rosbag2_performance_benchmarking benchmark_launch.py benchmark:=`ros2 pkg prefix rosbag2_performance_benchmarking`/share/rosbag2_performance_benchmarking/config/benchmarks/test.yaml producers:=`ros2 pkg prefix rosbag2_performance_benchmarking`/share/rosbag2_performance_benchmarking/config/producers/mixed_110Mbs.yaml
The summary of benchmark goes into result file described in benchmark config: <db_root_folder>/<BENCHMARK_NAME>/summary_result_file
where BENCHMARK_NAME
is a name generated from config names, transport type and timestamp.
For human friendly output, a postprocess report generation tool can be used. Launch it with benchmark result directory as an -i
argument (directory with summary_result_file
file):
scripts/report_gen.py -i <BENCHMARK_RESULT_DIR>
Binaries
These are used in the launch file:
-
benchmark_publishers
- runs publishers based on provided parameters. Used whenno_transport
parameter is set toFalse
; -
writer_benchmark
- runs storage-only benchmarking, mimicking subscription queues but using no transport whatsoever. Used whenno_transport
parameter is set toTrue
. -
results_writer
- based on provider parameters, write results (percentage of recorded messages) after recording. One of the parameters is the storage uri, which is used to read the bag metadata file.
Compression
Note that while you can opt to select compression for benchmarking, the generated data is random so it is likely not representative for this specific case. To publish non-random data, you need to modify the ByteProducer.
Building
To build the package in the rosbag2 build process, make sure to turn BUILD_ROSBAG2_BENCHMARKS
flag on (e.g. colcon build --cmake-args -DBUILD_ROSBAG2_BENCHMARKS=1
)
If you already built rosbag2, you can use packages-select
option to build benchmarks.
Example: colcon build --packages-select rosbag2_performance_benchmarking --cmake-args -DBUILD_ROSBAG2_BENCHMARKS=1
.
General knowledge: I/O benchmarking
Background: benchmarking disk writes on your system
It might be useful to first understand what limitation your disk poses to the throughput of data recording. Performance of bag write can’t be higher over extended period of time (you can only use as much memory).
Using dd command
dd if=/dev/zero of=/tmp/output conv=fdatasync bs=384k count=1k; rm -f /tmp/output
This method is not great for benchmarking the disk but an easy way to start since it requires no dependencies. This will write zeros to the /tmp/output file with block size 384k, 1000 blocks, ends when write finishes. Make sure to benchmark the disk which your bags will be written to (check your mount points and change “/tmp/output” to another path if needed). Note: this depends on parameters used and whatever else is running on your system but can give you a ballpark figure when ran several times.
Using fio
For more sophisticated & accurate benchmarks, see the fio
command. An example for big data blocks is: fio --name TEST --eta-newline=5s --filename=fio-tempfile.dat --rw=write --size=500m --io_size=10g --blocksize=1024k --ioengine=libaio --fsync=10000 --iodepth=32 --direct=1 --numjobs=1 --runtime=60 --group_reporting
.
Profiling bags I/O with tools
Tools that can help in I/O profiling: sudo apt-get install iotop ioping sysstat
-
iotop
works similar astop
command, but shows disk reads, writes, swaps and I/O %. Can be used at higher frequency in batch mode with specified process to deliver data that can be plotted.- Example use:
sudo iotop -h -d 0.1 -t -b -o -p <PID>
after running the bag.
- Example use:
-
ioping
can be used to check latency of requests to device -
strace
can help determine syscalls associated with the bottleneck.- Example use:
strace -c ros2 bag record /image --max-cache-size 10 -o ./tmp
. You will see a report after finishing recording with Ctrl-C.
- Example use:
Changelog for package rosbag2_performance_benchmarking
0.15.12 (2024-07-28)
0.15.11 (2024-05-20)
0.15.10 (2024-05-17)
0.15.9 (2024-01-24)
0.15.8 (2023-09-19)
0.15.7 (2023-07-18)
0.15.6 (2023-06-05)
0.15.5 (2023-04-25)
0.15.4 (2023-01-10)
0.15.3 (2022-11-07)
0.15.2 (2022-05-11)
0.15.1 (2022-04-06)
0.15.0 (2022-04-05)
0.14.1 (2022-03-29)
- Bump version number to avoid conflict
- Contributors: Chris Lalancette
0.14.0 (2022-03-29)
- Install headers to include/${PROJECT_NAME} (#958)
- Contributors: Shane Loretz
0.13.0 (2022-01-13)
0.12.0 (2021-12-17)
- Enable YAML encoding/decoding for RecordOptions and StorageOptions
(#916)
- Enable YAML encoding/decoding for RecordOptions and StorageOptions
- Contributors: Emerson Knapp
0.11.0 (2021-11-08)
- Update package maintainers (#899)
- Contributors: Michel Hidalgo
0.10.1 (2021-10-22)
0.10.0 (2021-10-19)
- Updated node declare_parameter to new syntax (#882)
- Updated benchmark package to use writer close() instead of old reset() (#881)
- Contributors: Adam Dąbrowski
0.9.0 (2021-05-17)
0.8.0 (2021-04-19)
0.7.0 (2021-03-18)
- fixed a memory leak in no-transport benchmark (#674)
- report of performance improvements in rosbag2 (roughly since Foxy) (#651)
- Performance benchmarking improvements (#634)
- Contributors: Adam Dąbrowski, Piotr Jaroszek
0.6.0 (2021-02-01)
- Performance benchmarking refactor (#594)
- Contributors: Adam Dąbrowski
0.5.0 (2020-12-02)
- Sqlite storage double buffering (#546)
- Contributors: Adam Dąbrowski
0.4.0 (2020-11-19)
- read yaml config file (#497)
- add storage_config_uri (#493)
- Update the package.xml files with the latest Open Robotics maintainers (#535)
- performance testing packages (#442)
- Contributors: Adam Dąbrowski, Karsten Knese, Michael Jeronimo
0.3.2 (2020-06-03)
0.3.1 (2020-06-01)
0.3.0 (2020-05-26)
0.2.8 (2020-05-18)
0.2.7 (2020-05-12)
0.2.6 (2020-05-07)
0.2.5 (2020-04-30)
0.2.4 (2019-11-18 17:51)
0.2.3 (2019-11-18 13:55)
0.2.2 (2019-11-13)
0.2.1 (2019-10-23)
0.2.0 (2019-09-26)
0.1.2 (2019-05-20)
0.1.1 (2019-05-09)
0.1.0 (2019-05-08)
0.0.5 (2018-12-27)
0.0.4 (2018-12-19)
0.0.3 (2018-12-14)
0.0.2 (2018-12-12)
0.0.1 (2018-12-11)
Wiki Tutorials
Package Dependencies
Deps | Name |
---|---|
ament_cmake | |
ament_lint_auto | |
ament_lint_common | |
rclcpp | |
rosbag2_compression | |
rosbag2_cpp | |
rosbag2_storage | |
rmw | |
std_msgs | |
yaml_cpp_vendor |
System Dependencies
Dependant Packages
Launch files
Messages
Services
Plugins
Recent questions tagged rosbag2_performance_benchmarking at Robotics Stack Exchange
|
Package Summary
Tags | No category tags. |
Version | 0.22.8 |
License | Apache License 2.0 |
Build type | AMENT_CMAKE |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/ros2/rosbag2.git |
VCS Type | git |
VCS Version | iron |
Last Updated | 2024-11-11 |
Dev Status | DEVELOPED |
CI status | No Continuous Integration |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Michael Orlov
- Geoffrey Biggs
- Michel Hidalgo
- Adam Dabrowski
Authors
Rosbag2 writer benchmarking
The primary package to test performance of the rosbag2.
How it works
Use benchmark_launch.py
launchfile to run an entire set of benchmarks.
Launchfile requires two arguments:
-
benchmark
- provides benchmark description (how many repetitions, cache size, database configuration etc.), -
producers
- provides producers description (how many publisher/producer instances, frequency, messages size etc.)
Templates for these configuration files are in config
directory of this package.
To run test benchmark (with test.yaml
and mixed_110Mbs.yaml
):
ros2 launch rosbag2_performance_benchmarking benchmark_launch.py benchmark:=`ros2 pkg prefix rosbag2_performance_benchmarking`/share/rosbag2_performance_benchmarking/config/benchmarks/test.yaml producers:=`ros2 pkg prefix rosbag2_performance_benchmarking`/share/rosbag2_performance_benchmarking/config/producers/mixed_110Mbs.yaml
The summary of benchmark goes into result file described in benchmark config: <bag_root_folder>/<BENCHMARK_NAME>/summary_result_file
where BENCHMARK_NAME
is a name generated from config names, transport type and timestamp.
For human friendly output, a postprocess report generation tool can be used. Launch it with benchmark result directory as an -i
argument (directory with summary_result_file
file):
scripts/report_gen.py -i <BENCHMARK_RESULT_DIR>
Binaries
These are used in the launch file:
-
benchmark_publishers
- runs publishers based on provided parameters. Used whenno_transport
parameter is set toFalse
; -
writer_benchmark
- runs storage-only benchmarking, mimicking subscription queues but using no transport whatsoever. Used whenno_transport
parameter is set toTrue
. -
results_writer
- based on provider parameters, write results (percentage of recorded messages) after recording. One of the parameters is the storage uri, which is used to read the bag metadata file.
Compression
Note that while you can opt to select compression for benchmarking, the generated data is random so it is likely not representative for this specific case. To publish non-random data, you need to modify the ByteProducer.
Number of publisher threads
In the case of the benchmark_publishers
binary, a pool of threads is created to run the publishers. By default,
the number of threads is equal to the number of publishers. It is possible to change the number of threads
using the optional number_of_threads
parameter.
Building
To build the package in the rosbag2 build process, make sure to turn BUILD_ROSBAG2_BENCHMARKS
flag on (e.g. colcon build --cmake-args -DBUILD_ROSBAG2_BENCHMARKS=1
)
If you already built rosbag2, you can use packages-select
option to build benchmarks.
Example: colcon build --packages-select rosbag2_performance_benchmarking --cmake-args -DBUILD_ROSBAG2_BENCHMARKS=1
.
General knowledge: I/O benchmarking
Background: benchmarking disk writes on your system
It might be useful to first understand what limitation your disk poses to the throughput of data recording. Performance of bag write can’t be higher over extended period of time (you can only use as much memory).
Using dd command
dd if=/dev/zero of=/tmp/output conv=fdatasync bs=384k count=1k; rm -f /tmp/output
This method is not great for benchmarking the disk but an easy way to start since it requires no dependencies. This will write zeros to the /tmp/output file with block size 384k, 1000 blocks, ends when write finishes. Make sure to benchmark the disk which your bags will be written to (check your mount points and change “/tmp/output” to another path if needed). Note: this depends on parameters used and whatever else is running on your system but can give you a ballpark figure when ran several times.
Using fio
For more sophisticated & accurate benchmarks, see the fio
command. An example for big data blocks is: fio --name TEST --eta-newline=5s --filename=fio-tempfile.dat --rw=write --size=500m --io_size=10g --blocksize=1024k --ioengine=libaio --fsync=10000 --iodepth=32 --direct=1 --numjobs=1 --runtime=60 --group_reporting
.
Profiling bags I/O with tools
Tools that can help in I/O profiling: sudo apt-get install iotop ioping sysstat
-
iotop
works similar astop
command, but shows disk reads, writes, swaps and I/O %. Can be used at higher frequency in batch mode with specified process to deliver data that can be plotted.- Example use:
sudo iotop -h -d 0.1 -t -b -o -p <PID>
after running the bag.
- Example use:
-
ioping
can be used to check latency of requests to device -
strace
can help determine syscalls associated with the bottleneck.- Example use:
strace -c ros2 bag record /image --max-cache-size 10 -o ./tmp
. You will see a report after finishing recording with Ctrl-C.
- Example use:
Changelog for package rosbag2_performance_benchmarking
0.22.8 (2024-11-09)
0.22.7 (2024-07-11)
0.22.6 (2024-02-07)
0.22.5 (2023-11-18)
0.22.4 (2023-10-24)
0.22.3 (2023-09-08)
0.22.2 (2023-07-14)
- Add config option to use storage_id parameter in benchmark_launch.py (#1318)
- Contributors: Michael Orlov
0.22.1 (2023-05-18)
0.22.0 (2023-04-18)
- Add tests for rosbag2_performance_benchmarking pkg (#1268)
- Contributors: Michael Orlov
0.21.0 (2023-04-12)
- Fix expectations for rosbag2 return code in rosbag2_performance_benchmarking (#1267)
- Update rosbag2 to C++17. (#1238)
- Use thread pool to run benchmark publishers in rosbag2_performance_benchmarking (#1250)
- Use target_link_libraries instead of ament_target_dependencies (#1202)
- Contributors: Chris Lalancette, Daisuke Nishimatsu, Michael Orlov, Shane Loretz, carlossvg
0.20.0 (2023-02-14)
- Skip ament_package() call when not building rosbag2_performance_benchmarking (#1242)
- Contributors: Shane Loretz
0.19.0 (2023-01-13)
- Add option to specify a message type (#1153)
- Add Michael Orlov as maintainer in rosbag2 packages (#1215)
- Replace language for "db3"/"db"/"database" (#1194)
- Remove explicit sqlite3 from code (#1166)
- Contributors: Emerson Knapp, Michael Orlov, carlossvg
0.18.0 (2022-11-15)
0.17.0 (2022-07-30)
0.16.0 (2022-05-11)
0.15.1 (2022-04-06)
0.15.0 (2022-04-05)
0.14.1 (2022-03-29)
- Bump version number to avoid conflict
- Contributors: Chris Lalancette
0.14.0 (2022-03-29)
- Install headers to include/${PROJECT_NAME} (#958)
- Contributors: Shane Loretz
0.13.0 (2022-01-13)
0.12.0 (2021-12-17)
- Enable YAML encoding/decoding for RecordOptions and StorageOptions
(#916)
- Enable YAML encoding/decoding for RecordOptions and StorageOptions
- Contributors: Emerson Knapp
0.11.0 (2021-11-08)
- Update package maintainers (#899)
- Contributors: Michel Hidalgo
0.10.1 (2021-10-22)
0.10.0 (2021-10-19)
- Updated node declare_parameter to new syntax (#882)
- Updated benchmark package to use writer close() instead of old reset() (#881)
- Contributors: Adam Dąbrowski
0.9.0 (2021-05-17)
0.8.0 (2021-04-19)
0.7.0 (2021-03-18)
- fixed a memory leak in no-transport benchmark (#674)
- report of performance improvements in rosbag2 (roughly since Foxy) (#651)
- Performance benchmarking improvements (#634)
- Contributors: Adam Dąbrowski, Piotr Jaroszek
0.6.0 (2021-02-01)
- Performance benchmarking refactor (#594)
- Contributors: Adam Dąbrowski
0.5.0 (2020-12-02)
- Sqlite storage double buffering (#546)
- Contributors: Adam Dąbrowski
0.4.0 (2020-11-19)
- read yaml config file (#497)
- add storage_config_uri (#493)
- Update the package.xml files with the latest Open Robotics maintainers (#535)
- performance testing packages (#442)
- Contributors: Adam Dąbrowski, Karsten Knese, Michael Jeronimo
0.3.2 (2020-06-03)
0.3.1 (2020-06-01)
0.3.0 (2020-05-26)
0.2.8 (2020-05-18)
0.2.7 (2020-05-12)
0.2.6 (2020-05-07)
0.2.5 (2020-04-30)
0.2.4 (2019-11-18 17:51)
0.2.3 (2019-11-18 13:55)
0.2.2 (2019-11-13)
0.2.1 (2019-10-23)
0.2.0 (2019-09-26)
0.1.2 (2019-05-20)
0.1.1 (2019-05-09)
0.1.0 (2019-05-08)
0.0.5 (2018-12-27)
0.0.4 (2018-12-19)
0.0.3 (2018-12-14)
0.0.2 (2018-12-12)
0.0.1 (2018-12-11)
Wiki Tutorials
Package Dependencies
System Dependencies
Dependant Packages
Launch files
Messages
Services
Plugins
Recent questions tagged rosbag2_performance_benchmarking at Robotics Stack Exchange
|
Package Summary
Tags | No category tags. |
Version | 0.26.5 |
License | Apache License 2.0 |
Build type | AMENT_CMAKE |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/ros2/rosbag2.git |
VCS Type | git |
VCS Version | jazzy |
Last Updated | 2024-11-07 |
Dev Status | DEVELOPED |
CI status | No Continuous Integration |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Michael Orlov
- Geoffrey Biggs
- Michel Hidalgo
- Adam Dabrowski
Authors
Rosbag2 writer benchmarking
The primary package to test performance of the rosbag2.
How it works
Use benchmark_launch.py
launchfile to run an entire set of benchmarks.
Launchfile requires two arguments:
-
benchmark
- provides benchmark description (how many repetitions, cache size, database configuration etc.), -
producers
- provides producers description (how many publisher/producer instances, frequency, messages size etc.)
Templates for these configuration files are in config
directory of this package.
To run test benchmark (with test.yaml
and mixed_110Mbs.yaml
):
ros2 launch rosbag2_performance_benchmarking benchmark_launch.py benchmark:=`ros2 pkg prefix rosbag2_performance_benchmarking`/share/rosbag2_performance_benchmarking/config/benchmarks/test.yaml producers:=`ros2 pkg prefix rosbag2_performance_benchmarking`/share/rosbag2_performance_benchmarking/config/producers/mixed_110Mbs.yaml
The summary of benchmark goes into result file described in benchmark config: <bag_root_folder>/<BENCHMARK_NAME>/summary_result_file
where BENCHMARK_NAME
is a name generated from config names, transport type and timestamp.
For human friendly output, a postprocess report generation tool can be used. Launch it with benchmark result directory as an -i
argument (directory with summary_result_file
file):
scripts/report_gen.py -i <BENCHMARK_RESULT_DIR>
Binaries
These are used in the launch file:
-
benchmark_publishers
- runs publishers based on provided parameters. Used whenno_transport
parameter is set toFalse
; -
writer_benchmark
- runs storage-only benchmarking, mimicking subscription queues but using no transport whatsoever. Used whenno_transport
parameter is set toTrue
. -
results_writer
- based on provider parameters, write results (percentage of recorded messages) after recording. One of the parameters is the storage uri, which is used to read the bag metadata file.
Compression
Note that while you can opt to select compression for benchmarking, the generated data is random so it is likely not representative for this specific case. To publish non-random data, you need to modify the ByteProducer.
Number of publisher threads
In the case of the benchmark_publishers
binary, a pool of threads is created to run the publishers. By default,
the number of threads is equal to the number of publishers. It is possible to change the number of threads
using the optional number_of_threads
parameter.
Building
To build the package in the rosbag2 build process, make sure to turn BUILD_ROSBAG2_BENCHMARKS
flag on (e.g. colcon build --cmake-args -DBUILD_ROSBAG2_BENCHMARKS=1
)
If you already built rosbag2, you can use packages-select
option to build benchmarks.
Example: colcon build --packages-select rosbag2_performance_benchmarking --cmake-args -DBUILD_ROSBAG2_BENCHMARKS=1
.
General knowledge: I/O benchmarking
Background: benchmarking disk writes on your system
It might be useful to first understand what limitation your disk poses to the throughput of data recording. Performance of bag write can’t be higher over extended period of time (you can only use as much memory).
Using dd command
dd if=/dev/zero of=/tmp/output conv=fdatasync bs=384k count=1k; rm -f /tmp/output
This method is not great for benchmarking the disk but an easy way to start since it requires no dependencies. This will write zeros to the /tmp/output file with block size 384k, 1000 blocks, ends when write finishes. Make sure to benchmark the disk which your bags will be written to (check your mount points and change “/tmp/output” to another path if needed). Note: this depends on parameters used and whatever else is running on your system but can give you a ballpark figure when ran several times.
Using fio
For more sophisticated & accurate benchmarks, see the fio
command. An example for big data blocks is: fio --name TEST --eta-newline=5s --filename=fio-tempfile.dat --rw=write --size=500m --io_size=10g --blocksize=1024k --ioengine=libaio --fsync=10000 --iodepth=32 --direct=1 --numjobs=1 --runtime=60 --group_reporting
.
Profiling bags I/O with tools
Tools that can help in I/O profiling: sudo apt-get install iotop ioping sysstat
-
iotop
works similar astop
command, but shows disk reads, writes, swaps and I/O %. Can be used at higher frequency in batch mode with specified process to deliver data that can be plotted.- Example use:
sudo iotop -h -d 0.1 -t -b -o -p <PID>
after running the bag.
- Example use:
-
ioping
can be used to check latency of requests to device -
strace
can help determine syscalls associated with the bottleneck.- Example use:
strace -c ros2 bag record /image --max-cache-size 10 -o ./tmp
. You will see a report after finishing recording with Ctrl-C.
- Example use:
Changelog for package rosbag2_performance_benchmarking
0.26.5 (2024-09-06)
0.26.4 (2024-06-27)
0.26.3 (2024-05-15)
0.26.2 (2024-04-24)
0.26.1 (2024-04-17)
0.26.0 (2024-04-16)
- Use middleware send and receive timestamps from message_info during recording (#1531)
- Update to use yaml-cpp version 0.8.0. (#1605)
- Contributors: Chris Lalancette, jmachowinski
0.25.0 (2024-03-27)
- Add option to set compression threads priority (#1457)
- Add per group statistics for rosbag2_performance_benchmarking report (#1306)
- Contributors: Michael Orlov, jmachowinski
0.24.0 (2023-07-11)
- Set CPU affinity for producers and recorder from benchmark parameters (#1305)
- Add CPU usage to rosbag2_performance_benchmarking results report (#1304)
- Add config option to use storage_id parameter in benchmark_launch.py (#1303)
- Contributors: Michael Orlov
0.23.0 (2023-04-28)
0.22.0 (2023-04-18)
- Add tests for rosbag2_performance_benchmarking pkg (#1268)
- Contributors: Michael Orlov
0.21.0 (2023-04-12)
- Fix expectations for rosbag2 return code in rosbag2_performance_benchmarking (#1267)
- Update rosbag2 to C++17. (#1238)
- Use thread pool to run benchmark publishers in rosbag2_performance_benchmarking (#1250)
- Use target_link_libraries instead of ament_target_dependencies (#1202)
- Contributors: Chris Lalancette, Daisuke Nishimatsu, Michael Orlov, Shane Loretz, carlossvg
0.20.0 (2023-02-14)
- Skip ament_package() call when not building rosbag2_performance_benchmarking (#1242)
- Contributors: Shane Loretz
0.19.0 (2023-01-13)
- Add option to specify a message type (#1153)
- Add Michael Orlov as maintainer in rosbag2 packages (#1215)
- Replace language for "db3"/"db"/"database" (#1194)
- Remove explicit sqlite3 from code (#1166)
- Contributors: Emerson Knapp, Michael Orlov, carlossvg
0.18.0 (2022-11-15)
0.17.0 (2022-07-30)
0.16.0 (2022-05-11)
0.15.1 (2022-04-06)
0.15.0 (2022-04-05)
0.14.1 (2022-03-29)
- Bump version number to avoid conflict
- Contributors: Chris Lalancette
0.14.0 (2022-03-29)
- Install headers to include/${PROJECT_NAME} (#958)
- Contributors: Shane Loretz
0.13.0 (2022-01-13)
0.12.0 (2021-12-17)
- Enable YAML encoding/decoding for RecordOptions and StorageOptions
(#916)
- Enable YAML encoding/decoding for RecordOptions and StorageOptions
- Contributors: Emerson Knapp
0.11.0 (2021-11-08)
- Update package maintainers (#899)
- Contributors: Michel Hidalgo
0.10.1 (2021-10-22)
0.10.0 (2021-10-19)
- Updated node declare_parameter to new syntax (#882)
- Updated benchmark package to use writer close() instead of old reset() (#881)
- Contributors: Adam Dąbrowski
0.9.0 (2021-05-17)
0.8.0 (2021-04-19)
0.7.0 (2021-03-18)
- fixed a memory leak in no-transport benchmark (#674)
- report of performance improvements in rosbag2 (roughly since Foxy) (#651)
- Performance benchmarking improvements (#634)
- Contributors: Adam Dąbrowski, Piotr Jaroszek
0.6.0 (2021-02-01)
- Performance benchmarking refactor (#594)
- Contributors: Adam Dąbrowski
0.5.0 (2020-12-02)
- Sqlite storage double buffering (#546)
- Contributors: Adam Dąbrowski
0.4.0 (2020-11-19)
- read yaml config file (#497)
- add storage_config_uri (#493)
- Update the package.xml files with the latest Open Robotics maintainers (#535)
- performance testing packages (#442)
- Contributors: Adam Dąbrowski, Karsten Knese, Michael Jeronimo
0.3.2 (2020-06-03)
0.3.1 (2020-06-01)
0.3.0 (2020-05-26)
0.2.8 (2020-05-18)
0.2.7 (2020-05-12)
0.2.6 (2020-05-07)
0.2.5 (2020-04-30)
0.2.4 (2019-11-18 17:51)
0.2.3 (2019-11-18 13:55)
0.2.2 (2019-11-13)
0.2.1 (2019-10-23)
0.2.0 (2019-09-26)
0.1.2 (2019-05-20)
0.1.1 (2019-05-09)
0.1.0 (2019-05-08)
0.0.5 (2018-12-27)
0.0.4 (2018-12-19)
0.0.3 (2018-12-14)
0.0.2 (2018-12-12)
0.0.1 (2018-12-11)
Wiki Tutorials
Package Dependencies
System Dependencies
Name |
---|
python3-psutil |
Dependant Packages
Launch files
Messages
Services
Plugins
Recent questions tagged rosbag2_performance_benchmarking at Robotics Stack Exchange
|
Package Summary
Tags | No category tags. |
Version | 0.29.0 |
License | Apache License 2.0 |
Build type | AMENT_CMAKE |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/ros2/rosbag2.git |
VCS Type | git |
VCS Version | rolling |
Last Updated | 2024-11-22 |
Dev Status | DEVELOPED |
CI status | No Continuous Integration |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Michael Orlov
- Geoffrey Biggs
- Michel Hidalgo
- Adam Dabrowski
Authors
Rosbag2 writer benchmarking
The primary package to test performance of the rosbag2.
How it works
Use benchmark_launch.py
launchfile to run an entire set of benchmarks.
Launchfile requires two arguments:
-
benchmark
- provides benchmark description (how many repetitions, cache size, database configuration etc.), -
producers
- provides producers description (how many publisher/producer instances, frequency, messages size etc.)
Templates for these configuration files are in config
directory of this package.
To run test benchmark (with test.yaml
and mixed_110Mbs.yaml
):
ros2 launch rosbag2_performance_benchmarking benchmark_launch.py benchmark:=`ros2 pkg prefix rosbag2_performance_benchmarking`/share/rosbag2_performance_benchmarking/config/benchmarks/test.yaml producers:=`ros2 pkg prefix rosbag2_performance_benchmarking`/share/rosbag2_performance_benchmarking/config/producers/mixed_110Mbs.yaml
The summary of benchmark goes into result file described in benchmark config: <bag_root_folder>/<BENCHMARK_NAME>/summary_result_file
where BENCHMARK_NAME
is a name generated from config names, transport type and timestamp.
For human friendly output, a postprocess report generation tool can be used. Launch it with benchmark result directory as an -i
argument (directory with summary_result_file
file):
scripts/report_gen.py -i <BENCHMARK_RESULT_DIR>
Binaries
These are used in the launch file:
-
benchmark_publishers
- runs publishers based on provided parameters. Used whenno_transport
parameter is set toFalse
; -
writer_benchmark
- runs storage-only benchmarking, mimicking subscription queues but using no transport whatsoever. Used whenno_transport
parameter is set toTrue
. -
results_writer
- based on provider parameters, write results (percentage of recorded messages) after recording. One of the parameters is the storage uri, which is used to read the bag metadata file.
Compression
Note that while you can opt to select compression for benchmarking, the generated data is random so it is likely not representative for this specific case. To publish non-random data, you need to modify the ByteProducer.
Number of publisher threads
In the case of the benchmark_publishers
binary, a pool of threads is created to run the publishers. By default,
the number of threads is equal to the number of publishers. It is possible to change the number of threads
using the optional number_of_threads
parameter.
Building
To build the package in the rosbag2 build process, make sure to turn BUILD_ROSBAG2_BENCHMARKS
flag on (e.g. colcon build --cmake-args -DBUILD_ROSBAG2_BENCHMARKS=1
)
If you already built rosbag2, you can use packages-select
option to build benchmarks.
Example: colcon build --packages-select rosbag2_performance_benchmarking --cmake-args -DBUILD_ROSBAG2_BENCHMARKS=1
.
General knowledge: I/O benchmarking
Background: benchmarking disk writes on your system
It might be useful to first understand what limitation your disk poses to the throughput of data recording. Performance of bag write can’t be higher over extended period of time (you can only use as much memory).
Using dd command
dd if=/dev/zero of=/tmp/output conv=fdatasync bs=384k count=1k; rm -f /tmp/output
This method is not great for benchmarking the disk but an easy way to start since it requires no dependencies. This will write zeros to the /tmp/output file with block size 384k, 1000 blocks, ends when write finishes. Make sure to benchmark the disk which your bags will be written to (check your mount points and change “/tmp/output” to another path if needed). Note: this depends on parameters used and whatever else is running on your system but can give you a ballpark figure when ran several times.
Using fio
For more sophisticated & accurate benchmarks, see the fio
command. An example for big data blocks is: fio --name TEST --eta-newline=5s --filename=fio-tempfile.dat --rw=write --size=500m --io_size=10g --blocksize=1024k --ioengine=libaio --fsync=10000 --iodepth=32 --direct=1 --numjobs=1 --runtime=60 --group_reporting
.
Profiling bags I/O with tools
Tools that can help in I/O profiling: sudo apt-get install iotop ioping sysstat
-
iotop
works similar astop
command, but shows disk reads, writes, swaps and I/O %. Can be used at higher frequency in batch mode with specified process to deliver data that can be plotted.- Example use:
sudo iotop -h -d 0.1 -t -b -o -p <PID>
after running the bag.
- Example use:
-
ioping
can be used to check latency of requests to device -
strace
can help determine syscalls associated with the bottleneck.- Example use:
strace -c ros2 bag record /image --max-cache-size 10 -o ./tmp
. You will see a report after finishing recording with Ctrl-C.
- Example use:
Changelog for package rosbag2_performance_benchmarking
0.29.0 (2024-09-03)
0.28.0 (2024-06-17)
0.27.0 (2024-04-30)
0.26.1 (2024-04-17)
0.26.0 (2024-04-16)
- Use middleware send and receive timestamps from message_info during recording (#1531)
- Update to use yaml-cpp version 0.8.0. (#1605)
- Contributors: Chris Lalancette, jmachowinski
0.25.0 (2024-03-27)
- Add option to set compression threads priority (#1457)
- Add per group statistics for rosbag2_performance_benchmarking report (#1306)
- Contributors: Michael Orlov, jmachowinski
0.24.0 (2023-07-11)
- Set CPU affinity for producers and recorder from benchmark parameters (#1305)
- Add CPU usage to rosbag2_performance_benchmarking results report (#1304)
- Add config option to use storage_id parameter in benchmark_launch.py (#1303)
- Contributors: Michael Orlov
0.23.0 (2023-04-28)
0.22.0 (2023-04-18)
- Add tests for rosbag2_performance_benchmarking pkg (#1268)
- Contributors: Michael Orlov
0.21.0 (2023-04-12)
- Fix expectations for rosbag2 return code in rosbag2_performance_benchmarking (#1267)
- Update rosbag2 to C++17. (#1238)
- Use thread pool to run benchmark publishers in rosbag2_performance_benchmarking (#1250)
- Use target_link_libraries instead of ament_target_dependencies (#1202)
- Contributors: Chris Lalancette, Daisuke Nishimatsu, Michael Orlov, Shane Loretz, carlossvg
0.20.0 (2023-02-14)
- Skip ament_package() call when not building rosbag2_performance_benchmarking (#1242)
- Contributors: Shane Loretz
0.19.0 (2023-01-13)
- Add option to specify a message type (#1153)
- Add Michael Orlov as maintainer in rosbag2 packages (#1215)
- Replace language for "db3"/"db"/"database" (#1194)
- Remove explicit sqlite3 from code (#1166)
- Contributors: Emerson Knapp, Michael Orlov, carlossvg
0.18.0 (2022-11-15)
0.17.0 (2022-07-30)
0.16.0 (2022-05-11)
0.15.1 (2022-04-06)
0.15.0 (2022-04-05)
0.14.1 (2022-03-29)
- Bump version number to avoid conflict
- Contributors: Chris Lalancette
0.14.0 (2022-03-29)
- Install headers to include/${PROJECT_NAME} (#958)
- Contributors: Shane Loretz
0.13.0 (2022-01-13)
0.12.0 (2021-12-17)
- Enable YAML encoding/decoding for RecordOptions and StorageOptions
(#916)
- Enable YAML encoding/decoding for RecordOptions and StorageOptions
- Contributors: Emerson Knapp
0.11.0 (2021-11-08)
- Update package maintainers (#899)
- Contributors: Michel Hidalgo
0.10.1 (2021-10-22)
0.10.0 (2021-10-19)
- Updated node declare_parameter to new syntax (#882)
- Updated benchmark package to use writer close() instead of old reset() (#881)
- Contributors: Adam Dąbrowski
0.9.0 (2021-05-17)
0.8.0 (2021-04-19)
0.7.0 (2021-03-18)
- fixed a memory leak in no-transport benchmark (#674)
- report of performance improvements in rosbag2 (roughly since Foxy) (#651)
- Performance benchmarking improvements (#634)
- Contributors: Adam Dąbrowski, Piotr Jaroszek
0.6.0 (2021-02-01)
- Performance benchmarking refactor (#594)
- Contributors: Adam Dąbrowski
0.5.0 (2020-12-02)
- Sqlite storage double buffering (#546)
- Contributors: Adam Dąbrowski
0.4.0 (2020-11-19)
- read yaml config file (#497)
- add storage_config_uri (#493)
- Update the package.xml files with the latest Open Robotics maintainers (#535)
- performance testing packages (#442)
- Contributors: Adam Dąbrowski, Karsten Knese, Michael Jeronimo
0.3.2 (2020-06-03)
0.3.1 (2020-06-01)
0.3.0 (2020-05-26)
0.2.8 (2020-05-18)
0.2.7 (2020-05-12)
0.2.6 (2020-05-07)
0.2.5 (2020-04-30)
0.2.4 (2019-11-18 17:51)
0.2.3 (2019-11-18 13:55)
0.2.2 (2019-11-13)
0.2.1 (2019-10-23)
0.2.0 (2019-09-26)
0.1.2 (2019-05-20)
0.1.1 (2019-05-09)
0.1.0 (2019-05-08)
0.0.5 (2018-12-27)
0.0.4 (2018-12-19)
0.0.3 (2018-12-14)
0.0.2 (2018-12-12)
0.0.1 (2018-12-11)
Wiki Tutorials
Package Dependencies
System Dependencies
Name |
---|
python3-psutil |
Dependant Packages
Launch files
Messages
Services
Plugins
Recent questions tagged rosbag2_performance_benchmarking at Robotics Stack Exchange
|
Package Summary
Tags | No category tags. |
Version | 0.9.2 |
License | Apache License 2.0 |
Build type | AMENT_CMAKE |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/ros2/rosbag2.git |
VCS Type | git |
VCS Version | galactic |
Last Updated | 2022-09-29 |
Dev Status | DEVELOPED |
CI status | No Continuous Integration |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Karsten Knese
- Michael Jeronimo
- Adam Dabrowski
Authors
Rosbag2 writer benchmarking
The primary package to test performance of the rosbag2.
How it works
Use benchmark_launch.py
launchfile to run an entire set of benchmarks.
Launchfile requires two arguments:
-
benchmark
- provides benchmark description (how many repetitions, cache size, database configuration etc.), -
producers
- provides producers description (how many publisher/producer instances, frequency, messages size etc.)
Templates for these configuration files are in config
directory of this package.
To run test benchmark (with test.yaml
and mixed_110Mbs.yaml
):
ros2 launch rosbag2_performance_benchmarking benchmark_launch.py benchmark:=`ros2 pkg prefix rosbag2_performance_benchmarking`/share/rosbag2_performance_benchmarking/config/benchmarks/test.yaml producers:=`ros2 pkg prefix rosbag2_performance_benchmarking`/share/rosbag2_performance_benchmarking/config/producers/mixed_110Mbs.yaml
The summary of benchmark goes into result file described in benchmark config: <db_root_folder>/<BENCHMARK_NAME>/summary_result_file
where BENCHMARK_NAME
is a name generated from config names, transport type and timestamp.
For human friendly output, a postprocess report generation tool can be used. Launch it with benchmark result directory as an -i
argument (directory with summary_result_file
file):
scripts/report_gen.py -i <BENCHMARK_RESULT_DIR>
Binaries
These are used in the launch file:
-
benchmark_publishers
- runs publishers based on provided parameters. Used whenno_transport
parameter is set toFalse
; -
writer_benchmark
- runs storage-only benchmarking, mimicking subscription queues but using no transport whatsoever. Used whenno_transport
parameter is set toTrue
. -
results_writer
- based on provider parameters, write results (percentage of recorded messages) after recording. One of the parameters is the storage uri, which is used to read the bag metadata file.
Compression
Note that while you can opt to select compression for benchmarking, the generated data is random so it is likely not representative for this specific case. To publish non-random data, you need to modify the ByteProducer.
Building
To build the package in the rosbag2 build process, make sure to turn BUILD_ROSBAG2_BENCHMARKS
flag on (e.g. colcon build --cmake-args -DBUILD_ROSBAG2_BENCHMARKS=1
)
If you already built rosbag2, you can use packages-select
option to build benchmarks.
Example: colcon build --packages-select rosbag2_performance_benchmarking --cmake-args -DBUILD_ROSBAG2_BENCHMARKS=1
.
General knowledge: I/O benchmarking
Background: benchmarking disk writes on your system
It might be useful to first understand what limitation your disk poses to the throughput of data recording. Performance of bag write can’t be higher over extended period of time (you can only use as much memory).
Using dd command
dd if=/dev/zero of=/tmp/output conv=fdatasync bs=384k count=1k; rm -f /tmp/output
This method is not great for benchmarking the disk but an easy way to start since it requires no dependencies. This will write zeros to the /tmp/output file with block size 384k, 1000 blocks, ends when write finishes. Make sure to benchmark the disk which your bags will be written to (check your mount points and change “/tmp/output” to another path if needed). Note: this depends on parameters used and whatever else is running on your system but can give you a ballpark figure when ran several times.
Using fio
For more sophisticated & accurate benchmarks, see the fio
command. An example for big data blocks is: fio --name TEST --eta-newline=5s --filename=fio-tempfile.dat --rw=write --size=500m --io_size=10g --blocksize=1024k --ioengine=libaio --fsync=10000 --iodepth=32 --direct=1 --numjobs=1 --runtime=60 --group_reporting
.
Profiling bags I/O with tools
Tools that can help in I/O profiling: sudo apt-get install iotop ioping sysstat
-
iotop
works similar astop
command, but shows disk reads, writes, swaps and I/O %. Can be used at higher frequency in batch mode with specified process to deliver data that can be plotted.- Example use:
sudo iotop -h -d 0.1 -t -b -o -p <PID>
after running the bag.
- Example use:
-
ioping
can be used to check latency of requests to device -
strace
can help determine syscalls associated with the bottleneck.- Example use:
strace -c ros2 bag record /image --max-cache-size 10 -o ./tmp
. You will see a report after finishing recording with Ctrl-C.
- Example use:
Changelog for package rosbag2_performance_benchmarking
0.9.2 (2022-09-26)
- [backport galactic] Fix build of benchmarking package (#881, #882) (#883)
- Contributors: Adam Dąbrowski
0.9.1 (2021-07-08)
0.9.0 (2021-05-17)
0.8.0 (2021-04-19)
0.7.0 (2021-03-18)
- fixed a memory leak in no-transport benchmark (#674)
- report of performance improvements in rosbag2 (roughly since Foxy) (#651)
- Performance benchmarking improvements (#634)
- Contributors: Adam Dąbrowski, Piotr Jaroszek
0.6.0 (2021-02-01)
- Performance benchmarking refactor (#594)
- Contributors: Adam Dąbrowski
0.5.0 (2020-12-02)
- Sqlite storage double buffering (#546)
- Contributors: Adam Dąbrowski
0.4.0 (2020-11-19)
- read yaml config file (#497)
- add storage_config_uri (#493)
- Update the package.xml files with the latest Open Robotics maintainers (#535)
- performance testing packages (#442)
- Contributors: Adam Dąbrowski, Karsten Knese, Michael Jeronimo
0.3.2 (2020-06-03)
0.3.1 (2020-06-01)
0.3.0 (2020-05-26)
0.2.8 (2020-05-18)
0.2.7 (2020-05-12)
0.2.6 (2020-05-07)
0.2.5 (2020-04-30)
0.2.4 (2019-11-18 17:51)
0.2.3 (2019-11-18 13:55)
0.2.2 (2019-11-13)
0.2.1 (2019-10-23)
0.2.0 (2019-09-26)
0.1.2 (2019-05-20)
0.1.1 (2019-05-09)
0.1.0 (2019-05-08)
0.0.5 (2018-12-27)
0.0.4 (2018-12-19)
0.0.3 (2018-12-14)
0.0.2 (2018-12-12)
0.0.1 (2018-12-11)
Wiki Tutorials
Package Dependencies
Deps | Name |
---|---|
ament_cmake | |
ament_lint_auto | |
ament_lint_common | |
rclcpp | |
rosbag2_compression | |
rosbag2_cpp | |
rosbag2_storage | |
rmw | |
std_msgs | |
yaml_cpp_vendor |