utils/frame/benchmarking-cli/src/machine/README.md
benchmark machine commandDifferent Substrate chains can have different hardware requirements.
It is therefore important to be able to quickly gauge if a piece of hardware fits a chains' requirements.
The benchmark machine command archives this by measuring key metrics and making them comparable.
Invoking the command looks like this:
cargo run --profile=production -- benchmark machine --dev
The output on reference hardware:
+----------+----------------+---------------+--------------+-------------------+
| Category | Function | Score | Minimum | Result |
+----------+----------------+---------------+--------------+-------------------+
| CPU | BLAKE2-256 | 1023.00 MiB/s | 1.00 GiB/s | ✅ Pass ( 99.4 %) |
+----------+----------------+---------------+--------------+-------------------+
| CPU | SR25519-Verify | 665.13 KiB/s | 666.00 KiB/s | ✅ Pass ( 99.9 %) |
+----------+----------------+---------------+--------------+-------------------+
| Memory | Copy | 14.39 GiB/s | 14.32 GiB/s | ✅ Pass (100.4 %) |
+----------+----------------+---------------+--------------+-------------------+
| Disk | Seq Write | 457.00 MiB/s | 450.00 MiB/s | ✅ Pass (101.6 %) |
+----------+----------------+---------------+--------------+-------------------+
| Disk | Rnd Write | 190.00 MiB/s | 200.00 MiB/s | ✅ Pass ( 95.0 %) |
+----------+----------------+---------------+--------------+-------------------+
The score is the average result of each benchmark. It always adheres to "higher is better".
The category indicate which part of the hardware was benchmarked:
The function is the concrete benchmark that was run:
The score needs to reach the minimum in order to pass the benchmark. This can be reduced with the --tolerance flag.
The result indicated if a specific benchmark was passed by the machine or not. The percent number is the relative score reached to the minimum that is needed. The --tolerance flag is taken into account for this decision. For example a benchmark that passes even with 95% since the tolerance was set to 10% would look like this: ✅ Pass ( 95.0 %).
Ideally all results show a Pass and the program exits with code 0. Currently some of the benchmarks can fail even on reference hardware; they are still being improved to make them more deterministic.
Make sure to run nothing else on the machine when benchmarking it.
You can re-run them multiple times to get more reliable results.
--tolerance A percent number to reduce the minimum requirement. This should be used to ignore outliers of the benchmarks. The default value is 10%.--verify-duration How long the verification benchmark should run.--disk-duration How long the read and write benchmarks should run each.--allow-fail Always exit the program with code 0.--chain / --dev Specify the chain config to use. This will be used to compare the results with the requirements of the chain (WIP).--base-pathLicense: Apache-2.0
<!-- LINKS -->