-
Notifications
You must be signed in to change notification settings - Fork 87
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
Benchmark performance of a Hydra Head #186
Comments
Please leave a comment if you are particularly interested in some scenarios! |
We need to sharpen this. It will be quite hard to make this actually usable for more than one specific use case. However, I think this is quite useful to establish a baseline. Marking this as an idea until we have clarified concrete steps. |
Description of benchmarking use case:
It's a pretty general framework which is very much the purpose, the point of this application is not to create the most verifiable and permissionless system in the world, but to really lean into centralization and lax security to boost scalability/throughput as much as at it would make any sense while still calling it a blockchain application. |
Thanks @Trymyrt for helping conretizing this. I can't promise when we'll address your scenario, but it makes this thing more relevant! |
@Trymyrt So the scenario is basically a single client, posting one tx at a time consuming and producing a single UTxO, to a single Hydra-node? We normally compute the tps for confirmed txs, eg. transactions which are part of a snapshot. This is mostly what users or apps would want because it's only when it's confirmed (eg. in a block) that a tx is definitely "adopted". |
@Trymyrt I ran the existing benchmark with 1 node/1 client and a bunch of txs and here are some results:
The latency of 12.4 s translates to a throughput of 80tps. One thing we, or even you, could easily do is to have a custom set of transactions as a workload should you want more accurate figures for specific tx types (eg. with minting). The Dataset structure is relatively simple, it's an initial transaction (representing the CollectCom) and then a list of |
Running a micro-benchmark to measure the time it takes to apply a transaction to the ledger, I get the following for 10,000 txs
This means applying a single tx takes about 170 microsecond. There's of course a significant overhead in the whole roundtrip process of Submitting a tx, applying it to the L2 ledger, creating a snapshot, returning the snapshot confirmed if only because of serialisation and network communications overhead. |
I am experimenting with changes to the serialisation (Eg. using CBOR instead of JSON in the API Server), but facing the same low-level issue I faced earlier with the client disconnecting abruptly while waiting to receive notification of the close. |
After a long struggle, it seems we finally are onto something. Here is a run that demonstrates about 1000tps for single head/single node/single client case with some bottlenecks removed: And here is typical duration trace of main events/effects in the hydra-node:
Contention came mainly from 1. the way we persist the state, 2. lack of actual parallelism, and 3. inefficient logging of full state. |
Latest run of benchmark without any change in Server API serialisation:
=> No need to switch to CBOR now in Client <-> Server communications |
Why
Users want to know what is capable with Hydra in certain use cases.
What
For that, we want to extend our current benchmark suite with a concrete scenario to measure latency & throughput of actual Hydra Head configuration and transaction structure. The results shall be collected and made available on a continuous basis.
A scenario description should always include
The first scenario which we want to cover was contributed by @Trymyrt below: #186 (comment)
How
TBD
The text was updated successfully, but these errors were encountered: