-
Notifications
You must be signed in to change notification settings - Fork 683
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
feat(benchmarking): tooling for multi shard benchmarks #12918
base: master
Are you sure you want to change the base?
Conversation
Have you considered adding multi shard support to
Potential approach for multi shard support in
|
match &cli.command { | |
Commands::CreateSubAccounts(args) => { | |
create_sub_accounts(args).await?; | |
} | |
Commands::BenchmarkNativeTransfers(args) => { | |
native_transfer::benchmark(args).await?; | |
} | |
Commands::BenchmarkMpcSign(args) => { | |
contract::benchmark_mpc_sign(args).await?; | |
} |
Try adding new commands like Commands::CreateMultiShardSubAccounts
and others which call these functions once for each shard. Roughly this might look like:
match &cli.command {
Commands::CreateMultiShardSubAccounts(args) => {
for n in 0..args.num_shards {
// As this is just a sketch, it doesn't store task handles to check
// if they terminated successfully.
let shard_args = prepare_shard_args(args, n); // set account prefix, user_data_dir, etc
tokio::spawn(async move {
create_sub_accounts(shard_args).await?
});
}
}
}
Thanks for the suggestion @mooori |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #12918 +/- ##
==========================================
- Coverage 70.54% 70.52% -0.02%
==========================================
Files 851 851
Lines 174983 174983
Branches 174983 174983
==========================================
- Hits 123433 123413 -20
- Misses 46419 46438 +19
- Partials 5131 5132 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Usage of synth-bm
LGTM.
do | ||
date | ||
now=$(date +%s%3N) | ||
processed=$(curl -s localhost:3030/metrics | grep transaction_processed_total | grep -v "#" | awk '{ print $2 }') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You might want near_transaction_processed_successfully_total
or near_action_called_count.
This PR adds the script I've been using to benchmark
neard
TPS on a single node (for the moment).Benchmarks use the
synth-bm
tool under the hood.The aim is to have an simple and reproducible way to run tests. In the future, the structure of the script may evolve drastically, because we want to support multi node setups like forknet.
export CASE=cases/local/1_node_5_shard ./bench.sh stop-nodes ./bench.sh reset ./bench.sh init ./bench.sh start-nodes ./bench.sh create-accounts ./bench.sh native-transfers
case/local/
I believe this is the best place to add this tooling in
nearcore
, but let me know if you think otherwise.Update
README