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

Block stream benchmark tests #1798

Conversation

iamalwaysuncomfortable
Copy link
Contributor

@iamalwaysuncomfortable iamalwaysuncomfortable commented Apr 12, 2022

Ready for Review!

Motivation

The block streaming components should be benchmarked individually under stress that is normally expected to be seen in production. This PR introduces a bench script format + tools to simulate block streaming load.

In this PR

  • Bench script to test a particular component, but meant to be generalizable to others
  • Function to create mock ledger blocks with content similar to those seen in mainnet

Addresses #1707

Future Work

  • Write benchmarks for each block streaming component
  • Benchmark the entire integrated block streaming pipeline

ledger/db/src/test_utils/mock_ledger.rs Outdated Show resolved Hide resolved
ledger/streaming/api/src/error.rs Outdated Show resolved Hide resolved
ledger/streaming/client/benches/bench.rs Outdated Show resolved Hide resolved
ledger/streaming/client/benches/bench.rs Outdated Show resolved Hide resolved
ledger/streaming/client/src/block_validator.rs Outdated Show resolved Hide resolved
ledger/streaming/client/src/block_validator.rs Outdated Show resolved Hide resolved
ledger/streaming/client/src/block_validator.rs Outdated Show resolved Hide resolved
ledger/streaming/client/src/block_validator.rs Outdated Show resolved Hide resolved
ledger/streaming/client/benches/bench.rs Outdated Show resolved Hide resolved
@iamalwaysuncomfortable
Copy link
Contributor Author

Basically, out of a review of this currently, I'd like inputs on the fundamental approach which is:

  1. Building blocks that have content close to what mainnet blocks currently have and using those for benchmark tests
  2. Benchmarking individual blocksteram components by driving the streams individually to benchmark the speed of the logic being executed when the stream are driven
  3. Further I think the natural extension is combining components into maybe 1-2 different configurations of chained stream components and benchmarking integrated components in a similar way to the above.

Given those 3 points, does the team have any commentary on the approach, how it could be better, etc.?

@remoun , @jcape

@remoun
Copy link
Contributor

remoun commented Apr 12, 2022

Basically, out of a review of this currently, I'd like inputs on the fundamental approach which is:

  1. Building blocks that have content close to what mainnet blocks currently have and using those for benchmark tests

SGTM, if it's easy enough to approximate the mainnet config(s).

  1. Benchmarking individual blocksteram components by driving the streams individually to benchmark the speed of the logic being executed when the stream are driven

It seems higher leverage/more useful to benchmark the end-to-end pipelines.

  1. Further I think the natural extension is combining components into maybe 1-2 different configurations of chained stream components and benchmarking integrated components in a similar way to the above.

Agreed. I've started defining helpers that assemble the pipelines we expect to support, e.g. consensus node, consensus client, gRPC fanout repeater.

@iamalwaysuncomfortable iamalwaysuncomfortable force-pushed the feature/block_stream_benchmark_tests branch 2 times, most recently from 2e95405 to d5ab9cc Compare April 26, 2022 02:23
@iamalwaysuncomfortable iamalwaysuncomfortable force-pushed the feature/block_stream_benchmark_tests branch from 84525e1 to e60e20c Compare April 29, 2022 18:48
@iamalwaysuncomfortable iamalwaysuncomfortable changed the base branch from feature/block-streaming to block-streaming-prefactor April 29, 2022 18:50
@iamalwaysuncomfortable iamalwaysuncomfortable changed the base branch from block-streaming-prefactor to block-streaming-refactor April 29, 2022 18:50
@remoun remoun force-pushed the block-streaming-refactor branch from d0b492e to fbfd87b Compare May 10, 2022 02:22
@remoun remoun deleted the branch mobilecoinfoundation:block-streaming-refactor May 10, 2022 05:45
@remoun remoun closed this May 10, 2022
@remoun
Copy link
Contributor

remoun commented Jun 8, 2022

Hmm, I'm not sure how or why this got closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ledger-distribution Area: Ledger-Distribution
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Write cargo bench benchmarks for Ledger Streaming Elements
2 participants