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

add use_durable_nonce option #27151

Merged
merged 6 commits into from
Aug 26, 2022

Conversation

KirillLykov
Copy link
Contributor

@KirillLykov KirillLykov commented Aug 15, 2022

Problem

Final PR in the chain of PRs adding durable nonce transactions to bench-tps.

Requires #27176
Requires #27379

Summary of Changes

  • Introduce --use-durable-nonce option to cli
  • Request durable nonce in a loop

UPD:

TPS is now ~5k

Some plots with running with this option:
Screenshot 2022-08-26 at 17 07 14

The bottom plot is for data shreds: at the beggining there are many data shreds because we create nonce durable accounts. During transactions execution this metric is lower.

If we zoom into the transaction phase, we observe that the tps is spiky:
Screenshot 2022-08-26 at 17 10 47

It happens because it takes time to request blockhashes before executing transactions

Copy link
Contributor

@joncinque joncinque left a comment

Choose a reason for hiding this comment

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

Looks good! I mainly had a few questions for my own info

bench-tps/src/bench.rs Show resolved Hide resolved
bench-tps/src/bench.rs Outdated Show resolved Hide resolved
bench-tps/src/bench.rs Outdated Show resolved Hide resolved
bench-tps/src/bench.rs Show resolved Hide resolved
bench-tps/src/bench.rs Outdated Show resolved Hide resolved
@KirillLykov KirillLykov force-pushed the bench_tps_add_nonce_cli branch 2 times, most recently from 19de07a to d4e9d85 Compare August 25, 2022 15:26
@KirillLykov
Copy link
Contributor Author

@joncinque I've updated PR with get_multiple_accounts_with_commitment. This gave x3 speed up so in my private cluster TPS for durable nonce is ~1700tps (while for normal nonces ~5500tps)

Copy link
Contributor

@joncinque joncinque left a comment

Choose a reason for hiding this comment

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

Just some small nits, then this is good to go!

bench-tps/src/bench.rs Outdated Show resolved Hide resolved
bench-tps/src/bench.rs Outdated Show resolved Hide resolved
bench-tps/src/bench.rs Outdated Show resolved Hide resolved
bench-tps/src/bench.rs Outdated Show resolved Hide resolved
Comment on lines 618 to 621
let blockhashes: Vec<Hash> = pubkeys
.chunks(MAX_MULTIPLE_ACCOUNTS)
.map(|pubkeys| get_nonce_blockhashes(&client, &pubkeys))
.flatten()
.collect();
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Instead of chunking here, it might be faster to pass all of them to get_nonce_blockhashes and then do the chunking in the function, that way you can always fetch MAX_MULTIPLE_ACCOUNTS. What do you think?

Copy link
Contributor Author

@KirillLykov KirillLykov Aug 26, 2022

Choose a reason for hiding this comment

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

I've updated the code and tested it with private cluster.

I've added UPD section to the PR description with some plots from this run.
It looks like tps is spiky because we request all the blockhashes and later execute all the transactions. Spike width is ~4s while the gap is ~2s => it is possible to increase tps at most by 30% by overlapping these two phases.
I created an issue for this as a follow up since it requires major code reorganization: #27416

Copy link
Contributor

Choose a reason for hiding this comment

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

Awesome, and yes it makes sense to do that work separately

@KirillLykov KirillLykov force-pushed the bench_tps_add_nonce_cli branch from d4e9d85 to f03417e Compare August 25, 2022 18:09
@KirillLykov KirillLykov force-pushed the bench_tps_add_nonce_cli branch from f03417e to d8a2480 Compare August 26, 2022 12:47
Copy link
Contributor

@joncinque joncinque left a comment

Choose a reason for hiding this comment

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

Great job!

@KirillLykov
Copy link
Contributor Author

Great job!

thanks! it would be not possible without your comments

@KirillLykov KirillLykov merged commit e446c51 into solana-labs:master Aug 26, 2022
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.

2 participants