3

Substrate has introduced a flag called --no-hardware-benchmarks to disable automatic hardware benchmarks. This implies if the flag is not set, the benchmark should run automatically at startup and measure the CPU speed. Without this benchmark and using the version of substrate which has this new CLI option, I was expecting to see a report that would give comparable figures to the configuration of substrate reference hardware:

SUBSTRATE_REFERENCE_HARDWARE =
        [
        {
            "metric": "Blake2256",
            "minimum": {
                "MiBs": 1029.0
            }
        },
        {
            "metric": "Sr25519Verify",
            "minimum": {
                "KiBs": 666.0
            }
        },
        {
            "metric": "MemCopy",
            "minimum": {
                "GiBs": 14.323
            }
        },
        {
            "metric": "DiskSeqWrite",
            "minimum": {
                "MiBs": 450.0
            }
        },
        {
            "metric": "DiskRndWrite",
            "minimum": {
                "MiBs": 200.0
            }
        }
      ]

However I couldn't find such logs when I started my node. Is my usage and expectation correct?

1
  • Sounds like you're using an older version of substrate? It's in master and I would think it's in the june / july 2022 monthly tags.
    – Squirrel
    Aug 4, 2022 at 5:46

1 Answer 1

4

A v0.9.27 Polkadot node will print hardware and performance info on startup. It looks like this:

Parity Polkadot    
✌️  version 0.9.27-b017bad50d3    
❤️  by Parity Technologies <[email protected]>, 2017-2022    
📋 Chain specification: Polkadot    
🏷  Node name: ethereal-throne-1125    
⛓  Native runtime: polkadot-9270 (parity-polkadot-0.tx13.au0) 
   
# General hardware info
💻 Operating system: linux    
💻 CPU architecture: x86_64    
💻 Target environment: gnu
💻 CPU: 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz    
💻 CPU cores: 4    
💻 Memory: 31831MB    
💻 Kernel: 5.15.0-43-generic    
💻 Linux distribution: Ubuntu 22.04.1 LTS    
💻 Virtual machine: no

# Hardware benchmarks
🏁 CPU score: 1063MB/s    
🏁 Memory score: 17465MB/s    
🏁 Disk score (seq. writes): 2793MB/s    
🏁 Disk score (rand. writes): 348MB/s 

📦 Highest known block at #0    
〽️ Prometheus exporter started at 127.0.0.1:9615    

It is also the case for slightly earlier Polkadot versions.
You can see that there are two paragraphs of output that mention either hardware or its performance.
Now the --no-hardware-benchmarks flag will suppress this output by not running the benchmarks.

Additionally you can run them explicitly by calling polkadot benchmark machine.
This performs a longer and more precise benchmark. The output depends on your hardware:

Running machine benchmarks...    
+----------+----------------+--------------+--------------+-------------------+
| Category | Function       | Score        | Minimum      | Result            |
+=============================================================================+
| CPU      | BLAKE2-256     | 994.00 MiB/s | 1.00 GiB/s   | ✅ Pass ( 96.6 %) |
|----------+----------------+--------------+--------------+-------------------|
| CPU      | SR25519-Verify | 652.91 KiB/s | 666.00 KiB/s | ✅ Pass ( 98.0 %) |
|----------+----------------+--------------+--------------+-------------------|
| Memory   | Copy           | 15.46 GiB/s  | 14.32 GiB/s  | ✅ Pass (107.9 %) |
|----------+----------------+--------------+--------------+-------------------|
| Disk     | Seq Write      | 2.48 GiB/s   | 450.00 MiB/s | ✅ Pass (564.8 %) |
|----------+----------------+--------------+--------------+-------------------|
| Disk     | Rnd Write      | 300.62 MiB/s | 200.00 MiB/s | ✅ Pass (150.3 %) |
+----------+----------------+--------------+--------------+-------------------+
From 5 benchmarks in total, 5 passed and 0 failed (10% fault tolerance).    
The hardware meets the requirements 
4
  • Is there a debug/log level that should be enabled for the above log to show up?
    – Alex Sed
    Aug 6, 2022 at 6:53
  • 1
    No. You can go to the Release page and download a binary to try it out. Does it not work? Then please open an issue in Substrate. Please note that Substrate only officially supports Linux, so I never tested in on Windows. The docker image prints it as well. Aug 6, 2022 at 9:35
  • I’m testing it on Nodle parachain binary which is based on substrate branch: polkadot 0.9.26 and same cumulus branch version. I also ran “benchmark machine”. It took a while to execute meaning it was doing something but returned no logs.
    – Alex Sed
    Aug 7, 2022 at 10:35
  • 1
    Then that is an issue of the Nodle node, not Substrate in general. Could be that the command is not properly exposed or that something with the log level is wrong. You can probably open an issue in the Nodle repo and mention me (@ggwpez). Should look like this. Aug 7, 2022 at 13:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.