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

[fastx benchmarking] Removed unnecessary TX order sending #93

Closed
wants to merge 3 commits into from

Conversation

oxade
Copy link
Contributor

@oxade oxade commented Dec 26, 2021

fastx_flow
Reasoning:
Current benchmark measures B-C-D and F-G-H and returns the sum.
In lines 160-164 we already certify the TX (which eliminates steps B-D), so there is no need to send the orders to the authorities.
However in measuring the throughput, should we include this roundtrip just for completeness sake? @gdanezis

By removing B-D, throughput is 34% higher => 35000tx/s vs 26000 tx/s

Solution
This PR provides the option to measure B-C-D and F-G-H separately, or both via CLI selector.
Will enhance this in future to optionally measure end-to-end (B-H and B-L)

In lines 160-164 we already certify the TX, so there is no need to send the orders to the authorities.
However in measuring the throughput, should we include these just for completeness sake?
Copy link
Collaborator

@sblackshear sblackshear left a comment

Choose a reason for hiding this comment

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

  • I think if we get rid of this, we also want to eliminate the / 2 here--otherwise, our throughput # will be off.
  • Perhaps it also makes sense to get rid of
// Serialize order
let bufx = serialize_order(&order);
assert!(!bufx.is_empty());

above?

@oxade
Copy link
Contributor Author

oxade commented Dec 26, 2021

  • I think if we get rid of this, we also want to eliminate the / 2 here--otherwise, our throughput # will be off.
  • Perhaps it also makes sense to get rid of
// Serialize order
let bufx = serialize_order(&order);
assert!(!bufx.is_empty());

above?

Yes and yes. Lots to cleanup in this code. Forgot to mark it as draft PR
But ultimately do you think we should count both roundtrips in our throughput measurement?

We can also measure both separately for internal purposes but choose one consistent method to use for marketing/publicity.

@oxade oxade marked this pull request as draft December 27, 2021 00:15
@sblackshear
Copy link
Collaborator

sblackshear commented Dec 27, 2021

But ultimately do you think we should count both roundtrips in our throughput measurement?

I think counting F + G + H for throughput measurements (as this PR is doing) is simple + a good start. The old code (IIUC) was doing something a bit funky--it was including B + C + D + F + G + H (but not E), and it wasn't implemented in a way that forced D to finish before F begins (which might or might not skew the #'s).

@oxade
Copy link
Contributor Author

oxade commented Dec 27, 2021

But ultimately do you think we should count both roundtrips in our throughput measurement?

I think counting F + G + H for throughput measurements (as this PR is doing) is simple + a good start. The old code (IIUC) was doing something a bit funky--it was including B + C + D + F + G + H (but not E), and it wasn't implemented in a way that forced D to finish before F begins (which might or might not skew the #'s).

Precisely. Wanted to make sure I wasn't missing some reasoning behind the previous (funky) formulation.

Will make the changes to only count F+G+H. Thank you.

@oxade oxade self-assigned this Dec 27, 2021
@oxade oxade marked this pull request as ready for review December 27, 2021 04:58
@@ -105,12 +105,12 @@ impl ClientServerBenchmark {
};

// Pick an authority and create one state per shard.
let (public_auth0, secret_auth0) = keys.pop().unwrap();
let (public_auth0, secret_auth0) = &keys[0];
Copy link
Collaborator

Choose a reason for hiding this comment

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

This will use the same key for every authority, which I don't think we want.

@@ -34,16 +34,16 @@ struct ClientServerBenchmark {
#[structopt(long, default_value = "9555")]
port: u32,
/// Size of the FastPay committee
#[structopt(long, default_value = "10")]
#[structopt(name = "committee-size", long, default_value = "10")]
Copy link
Contributor

Choose a reason for hiding this comment

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

OK, I think what you're looking for here, rather than those names, is a parameter rename-all = "kebab_case" on the enclosing structopt attribute of ClientServerBenchmark (doc)

@gdanezis
Copy link
Collaborator

In lines 160-164 we already certify the TX (which eliminates steps B-D), so there is no need to send the orders to the authorities.

The goal of this benchmark is to estimate the throughput that one authority can support. This is why we process both an order and a certificate: when an authority operates in the wild it will need to process (about) one order for each certificate. So here we simulate a load that is close to what we expect in the wild.

@oxade oxade changed the title Removed unnecessary TX order sending [fastx benchmarking] Removed unnecessary TX order sending Dec 29, 2021
@oxade oxade marked this pull request as draft December 29, 2021 05:34
@oxade
Copy link
Contributor Author

oxade commented Dec 29, 2021

In lines 160-164 we already certify the TX (which eliminates steps B-D), so there is no need to send the orders to the authorities.

The goal of this benchmark is to estimate the throughput that one authority can support. This is why we process both an order and a certificate: when an authority operates in the wild it will need to process (about) one order for each certificate. So here we simulate a load that is close to what we expect in the wild.

@gdanezis so you wanna leave it as is?

@gdanezis
Copy link
Collaborator

In lines 160-164 we already certify the TX (which eliminates steps B-D), so there is no need to send the orders to the authorities.

The goal of this benchmark is to estimate the throughput that one authority can support. This is why we process both an order and a certificate: when an authority operates in the wild it will need to process (about) one order for each certificate. So here we simulate a load that is close to what we expect in the wild.

@gdanezis so you wanna leave it as is?

Right now the bench is measuring a reasonable proxy of cost of order + cost of cert processing. It might be worthwhile to have a flag that separate these two, and only measure one or the other. But just dropping the cost of processing orders just creates a blind spot I think.

@sblackshear
Copy link
Collaborator

But just dropping the cost of processing orders just creates a blind spot I think.

Makes sense to me. To suggest a path forward: let's leave the throughput benchmark as-is, and work on adding a new benchmark for latency that measures B -> L?

@oxade oxade changed the title [fastx benchmarking] Removed unnecessary TX order sending [fastx benchmarking] Selectively Measure Different Code Paths Dec 30, 2021
@oxade oxade changed the title [fastx benchmarking] Selectively Measure Different Code Paths [fastx benchmarking] Selectively Benchmark Different Code Paths Dec 30, 2021
@oxade oxade changed the title [fastx benchmarking] Selectively Benchmark Different Code Paths [fastx benchmarking] Removed unnecessary TX order sending Dec 30, 2021
@oxade
Copy link
Contributor Author

oxade commented Dec 30, 2021

But just dropping the cost of processing orders just creates a blind spot I think.

Makes sense to me. To suggest a path forward: let's leave the throughput benchmark as-is, and work on adding a new benchmark for latency that measures B -> L?

@sblackshear @gdanezis

In lines 160-164 we already certify the TX (which eliminates steps B-D), so there is no need to send the orders to the authorities.

The goal of this benchmark is to estimate the throughput that one authority can support. This is why we process both an order and a certificate: when an authority operates in the wild it will need to process (about) one order for each certificate. So here we simulate a load that is close to what we expect in the wild.

@gdanezis so you wanna leave it as is?

Right now the bench is measuring a reasonable proxy of cost of order + cost of cert processing. It might be worthwhile to have a flag that separate these two, and only measure one or the other. But just dropping the cost of processing orders just creates a blind spot I think.

Created PR to selectively measure Orders, Certs or both (default as is now)
#106

@oxade
Copy link
Contributor Author

oxade commented Dec 30, 2021

But just dropping the cost of processing orders just creates a blind spot I think.

Makes sense to me. To suggest a path forward: let's leave the throughput benchmark as-is, and work on adding a new benchmark for latency that measures B -> L?

@sblackshear got it. Have this now: #106
If this approach is acceptable, will extend it to measure B-L

@oxade oxade closed this Dec 30, 2021
@oxade oxade deleted the bugfix/benchmark_throughput_excess_counting branch January 22, 2022 23:07
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