-
Notifications
You must be signed in to change notification settings - Fork 344
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 getAccountInfo
RPC call
#3959
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -256,6 +256,7 @@ pub enum RpcBench { | |
TokenAccountsByOwner, | ||
Supply, | ||
TokenAccountsByDelegate, | ||
AccountInfo, | ||
} | ||
|
||
#[derive(Debug)] | ||
|
@@ -268,6 +269,7 @@ impl FromStr for RpcBench { | |
|
||
fn from_str(s: &str) -> Result<Self, Self::Err> { | ||
match s { | ||
"account-info" => Ok(RpcBench::AccountInfo), | ||
"slot" => Ok(RpcBench::Slot), | ||
"supply" => Ok(RpcBench::Supply), | ||
"multiple-accounts" => Ok(RpcBench::MultipleAccounts), | ||
|
@@ -390,6 +392,35 @@ fn run_rpc_bench_loop( | |
break; | ||
} | ||
match rpc_bench { | ||
RpcBench::AccountInfo => { | ||
let start: u64 = max_closed.load(Ordering::Relaxed); | ||
let end: u64 = max_created.load(Ordering::Relaxed); | ||
let seed_range = start..end; | ||
if seed_range.is_empty() { | ||
info!("get_account_info: No accounts have yet been created; skipping"); | ||
continue; | ||
} | ||
let seed = thread_rng().gen_range(seed_range).to_string(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Samples randomly from the range of seeds belonging to open accounts. |
||
let account_pubkey = | ||
Pubkey::create_with_seed(base_keypair_pubkey, &seed, program_id).unwrap(); | ||
let mut rpc_time = Measure::start("rpc-get-account-info"); | ||
match client.get_account(&account_pubkey) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Some percentage of these loads fail with: [2024-12-05T22:23:08.309451301Z INFO solana_accounts_cluster_bench] get_account_info error: Error { request: None, kind: RpcError(ForUser("AccountNotFound: pubkey=Bp88sz54nzCwcxv8S7K6s6Yw5MX4H2FVwVm5sufvBDPa")) } I don't know if https://github.com/anza-xyz/agave/blob/master/accounts-cluster-bench/src/main.rs#L643 Is that what's going on here? Is it some sort of race, where I try to get the account before the transaction has committed? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Correct, when push_transactions() returns the txs have been queued but not The code that create accounts is very involved, not sure it's easy to change |
||
Ok(_account) => { | ||
rpc_time.stop(); | ||
stats.success += 1; | ||
stats.total_success_time_us += rpc_time.as_us(); | ||
} | ||
Err(e) => { | ||
rpc_time.stop(); | ||
stats.total_errors_time_us += rpc_time.as_us(); | ||
stats.errors += 1; | ||
if last_error.elapsed().as_secs() > 2 { | ||
info!("get_account_info error: {:?}", e); | ||
last_error = Instant::now(); | ||
} | ||
} | ||
} | ||
} | ||
RpcBench::Slot => { | ||
let mut rpc_time = Measure::start("rpc-get-slot"); | ||
match client.get_slot() { | ||
|
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.
See note here: #3960.