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

A benchmark suite for the getBlock and getBlocks RPC calls #3992

Merged
merged 4 commits into from
Dec 9, 2024

Conversation

steveluscher
Copy link

Summary of Changes

     Running `/home/sol/src/agave/target/debug/solana-accounts-cluster-bench --identity /home/sol/.config/solana/id.json --iterations 0 --url l --rpc-bench block --rpc-bench blocks`
[2024-12-06T23:51:01.249719471Z INFO  solana_accounts_cluster_bench] Targeting http://localhost:8899
[2024-12-06T23:51:01.254262179Z INFO  solana_accounts_cluster_bench] Starting balance(s): [666938136880]
[2024-12-06T23:51:01.255387794Z INFO  solana_accounts_cluster_bench] creating 4 new
[2024-12-06T23:51:01.259331039Z INFO  solana_accounts_cluster_bench] txs: 4
[2024-12-06T23:51:01.284633098Z INFO  solana_accounts_cluster_bench] ids: 4
[2024-12-06T23:51:02.293571706Z INFO  solana_accounts_cluster_bench] creating 4 new
[2024-12-06T23:51:02.294493610Z INFO  solana_accounts_cluster_bench] txs: 4
[2024-12-06T23:51:02.317415390Z INFO  solana_accounts_cluster_bench] ids: 4
[2024-12-06T23:51:02.819277816Z INFO  solana_accounts_cluster_bench] creating 4 new
[2024-12-06T23:51:02.820025324Z INFO  solana_accounts_cluster_bench] txs: 4
[2024-12-06T23:51:02.834647911Z INFO  solana_accounts_cluster_bench] ids: 4
[2024-12-06T23:51:03.339562268Z INFO  solana_accounts_cluster_bench] creating 4 new
[2024-12-06T23:51:03.340272594Z INFO  solana_accounts_cluster_bench] txs: 4
[2024-12-06T23:51:03.355491408Z INFO  solana_accounts_cluster_bench] ids: 4
[2024-12-06T23:51:04.360027223Z INFO  solana_accounts_cluster_bench] creating 4 new
[2024-12-06T23:51:04.360836119Z INFO  solana_accounts_cluster_bench] txs: 4
[2024-12-06T23:51:04.375524212Z INFO  solana_accounts_cluster_bench] ids: 4
[2024-12-06T23:51:04.375561944Z INFO  solana_accounts_cluster_bench] total_accounts_created: 20 total_accounts_closed: 0 tx_sent_count: 20 loop_count: 7 balance(s): [666780919280]
[2024-12-06T23:51:04.876743463Z INFO  solana_accounts_cluster_bench] creating 4 new
[2024-12-06T23:51:04.877447477Z INFO  solana_accounts_cluster_bench] txs: 4
[2024-12-06T23:51:04.901852811Z INFO  solana_accounts_cluster_bench] ids: 4
[2024-12-06T23:51:05.256347975Z INFO  solana_accounts_cluster_bench] t(0) rpc(Block) iters: 792 success: 793 errors: 0
[2024-12-06T23:51:05.256388773Z INFO  solana_accounts_cluster_bench]  t(0) rpc(Block average success_time: 5041 us
[2024-12-06T23:51:05.257692240Z INFO  solana_accounts_cluster_bench] t(0) rpc(Blocks) iters: 796 success: 797 errors: 0
[2024-12-06T23:51:05.257735073Z INFO  solana_accounts_cluster_bench]  t(0) rpc(Blocks average success_time: 5021 us

Related: #3242.

@@ -586,6 +669,7 @@ fn run_accounts_bench(
loop {
if latest_blockhash.elapsed().as_millis() > 10_000 {
blockhash = poll_get_latest_blockhash(&client).expect("blockhash");
slot_height_atom.store(poll_slot_height(&client), Ordering::Relaxed);
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This means the slot height will be updated every 10 seconds, along with the blockhash. This is super dumb, but probably good enough.

}
}
RpcBench::Blocks => {
static NUM_BLOCKS_TO_FETCH: u64 = 100;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

inb4 ‘magic number.’
giphy-506291741

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we use the max allowed response size instead? for seniority of magic, ofc

alessandrod
alessandrod previously approved these changes Dec 7, 2024
@@ -329,6 +355,7 @@ fn run_rpc_bench_loop(
program_id: &Pubkey,
max_closed: &AtomicU64,
max_created: &AtomicU64,
slot_height_atom: &AtomicU64,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: here and everywhere else, I'd call this slot_height, then you can rebind the load result on the same name

@steveluscher
Copy link
Author

Used MAX_GET_CONFIRMED_BLOCKS_RANGE in place of magic number. Renamed bindings to slot_height.

t-nelson
t-nelson previously approved these changes Dec 7, 2024
@steveluscher
Copy link
Author

Updated this to move the Measure line right above the actual RPC call.

alessandrod
alessandrod previously approved these changes Dec 9, 2024
t-nelson
t-nelson previously approved these changes Dec 9, 2024
@steveluscher steveluscher dismissed stale reviews from t-nelson and alessandrod via 0985099 December 9, 2024 17:39
@steveluscher
Copy link
Author

Resolved merge conflicts with master ergo review required.

@steveluscher steveluscher merged commit 889639b into anza-xyz:master Dec 9, 2024
24 of 33 checks passed
@steveluscher steveluscher deleted the get-blocks-bench branch December 9, 2024 18:03
@pgarg66
Copy link

pgarg66 commented Dec 9, 2024

Looks like this PR was merged with CI failures.

@steveluscher
Copy link
Author

@pgarg66 Yeah; sorry about that. See why, here: #3960 (comment)

@pgarg66
Copy link

pgarg66 commented Dec 9, 2024

@pgarg66 Yeah; sorry about that. See why, here: #3960 (comment)

Hey, no worries, thanks for pushing the fix!

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

Successfully merging this pull request may close these issues.

4 participants