Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sidechain single shard benchmark #248

Open
brenzi opened this issue May 24, 2021 · 8 comments
Open

sidechain single shard benchmark #248

brenzi opened this issue May 24, 2021 · 8 comments
Assignees
Milestone

Comments

@brenzi
Copy link
Collaborator

brenzi commented May 24, 2021

We claim to provide a solution to dramatically improve the scalability of blockchains in both tps and confirmation time latency. A benchmark will be taken out in order to prove this claim and quantify the limits of the implementation. We would expect the single-shard performance to be in the order of substrate’s tps throughput but with much lower confirmation times. It is further expected that horizontally scaling to multiple independent shards will be approximately linear until the block confirmations by themselves congest layer one. Empirically quantifying the amount of shards that can be served by a single polkadot parachain would be too much effort and is out of scope. Instead, we will provide a theoretical estimate of total tps based on the number and complexity of layer one extrinsics.
single-shard performance

  • 3 workers on 3 Intel SGX machines in at least two different locations.
  • layer one is a local testnet (not relevant for this test)
  • send extrinsics (balance transfers) to all three workers at increasing frequency. monitor txpool and confirmation time ( Ready, InBlock ).
    *No state queries
    • No dependency on layer one state
  • Repeat and add state queries (TrustedGetter) after each InBlock over RPC.
  • increase number of clients until performance issues arrise -> we want to find an upper limit of number of clients.

Substrate api client example: https://github.com/scs/substrate-api-client/blob/master/src/examples/example_benchmark_bulk_xt.rs

@brenzi brenzi added this to the M8.4 milestone May 24, 2021
@haerdib
Copy link
Contributor

haerdib commented Feb 18, 2022

Rust intern benchmarking: https://nickb.dev/blog/guidelines-on-benchmarking-and-rust with criterion, github

@haerdib
Copy link
Contributor

haerdib commented Feb 18, 2022

Linking the following issue: #231. if we use our cli, this might affect the benchmarking

@brenzi
Copy link
Collaborator Author

brenzi commented Feb 18, 2022

There is an example in the substrate-api-client which swamps a node with extrinsics. But that would require to write the entire benchmark in rust and not depend on python or bash to wrap our use case logic.

But I guess if we want the highest stress bandwidth possible, we should do that anyway

@masapr
Copy link
Contributor

masapr commented Mar 16, 2022

There exists already code in typescript to benchmark substrate:
https://github.com/paritytech/sub-flood
https://github.com/nikvolf/sub-bench
The links are from: https://wiki.polkadot.network/docs/build-tools-index#tools

It might make sense to setup a benchmark similar to sub-flood, but written in Rust. Also: to really compare the performance with substrate, the benchmark should also be run against substrate nodes, being run on the same hardware.

@masapr masapr assigned haerdib and unassigned masapr Apr 13, 2022
@masapr
Copy link
Contributor

masapr commented Apr 14, 2022

A few remarks on the current state (... in German ...):

Probleme mit Threading

  • Parallelisierung von rayon Bibliothek (siehe paralleler Loop in trusted_commands.rs Zeile 263-265) funktioniert nicht richtig / Transaktionen werden nicht so häufig abgesetzt, wie man hoffen würde. Ansonsten keine Probleme, Code läuft.
  • Parallelisierung mit std::thread::spawn -> hier kommt ein Fehler, dass der Code im Thread "static" sein muss.

Daher würde ich jetzt eher mehrere Prozesse starten, statt weiter am Threading von einem Prozess zu arbeiten.

Ablauf Benchmark
Folgender Ablauf ist jetzt so implementiert (und macht m. E. auch so Sinn):

  • Erst werden n Tupel von Accounts angelegt (account1, account2). Beide erhalten einen fixen Betrag von Alice (100000). -> dies wird synchron durchgeführt.
  • Anschliessend werden n Threads gestartet, mit folgendem Ablauf:
    account1 schickt 50000 an account2
    account2 schickt 50000 an account1
    usw.
  • am Ende werden die Resultate gesammelt (println während laufendem Prozess ist nicht gut, weil sonst alles durcheinander ist). und ausgegeben und in ein file benchmark_DATUM.txt geschrieben (im bin-Ordner).

Anleitung
https://integritee.atlassian.net/wiki/spaces/INTEGRITEE/pages/307036172/Run+Performance+Benchmarks

@brenzi
Copy link
Collaborator Author

brenzi commented Apr 14, 2022

Don't forget that we also want to bloat the state size, so we need an alternative mode where we create a new account with each transfer without reaping the old one (leave the ED)

@masapr
Copy link
Contributor

masapr commented Apr 14, 2022

I don't see a difference between creating many accounts in the beginning or continously creating more accounts.

@murerfel murerfel assigned masapr and unassigned haerdib Apr 26, 2022
@Niederb
Copy link
Contributor

Niederb commented May 20, 2022

See #752 regarding the issues with blocking

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants