You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
qa: Tool to estimate transaction latency from block data for kvstore app #9331
Following from #9330, we need a tool (which could be the same as the one developed in #9330, or could be separate) to scan through the blockchain data and compute transaction latency statistics for each throughput rate based on the timestamp in the transaction compared to the timestamp of the block in which it was included.
The following statistics must be computed for each throughput rate:
Minimum latency
Maximum latency
Average latency
Latency standard deviation
The output must be in a relatively easily machine-legible format, e.g. CSV, clearly showing throughput vs. each of the above latency statistics.
If you look at chapter 9 in Ethan's thesis, you'll see a bunch of graphs showing transaction throughput vs latency.
@cason please correct me if I'm wrong here, but my understanding of what we're doing is controlling the transaction throughput rate from the client's perspective while measuring transaction latency. In the paper, the aim was to measure raw Tendermint performance under non-adversarial conditions, but we're trying to get a sense of these metrics under "normal" operating conditions (i.e. with default timeout values, with mempool gossip enabled, in a large network).
So for example, we'd need to run the following "loads" of transactions into the system:
100 txs/sec for X mins (i.e. we tell tm-load-test to use a rate of 100 txs/sec while connected to a single WebSocket endpoint)
200 txs/sec for X mins
400 txs/sec for X mins
800 txs/sec for X mins
...
(up to some value that causes the latency to go asymptotic - this would be our "saturation point")
Where X could be some arbitrarily chosen value like 5 or 10 (i.e. run each test for 5 or 10 mins).
For each of those transaction throughput rates, we need to measure the transaction latency statistics. So for 100 txs/sec, we need min/max/avg/std. dev. latency; then for 200 txs/sec, we need min/max/avg/std. dev latency; etc.
If my understanding of our testing approach is correct, in a large network (175 validators), and if the current Tendermint implementation is comparable to the version in Ethan's thesis, we should expect the saturation point to be lower than 10k txs/sec.
Ah, I see, so for each experimental load we generate, we want to generate the listed latency statistics. I was a bit caught on the word throughput. We're not actually generating throughput statistics, but statistics for each of the attempted throughputs we generate (whether or not TM achieves this throughput is a different matter).
If my understanding of our testing approach is correct, in a large network (175 validators), and if the current Tendermint implementation is comparable to the version in Ethan's thesis, we should expect the saturation point to be lower than 10k txs/sec.
We're not actually generating throughput statistics, but statistics for each of the attempted throughputs we generate (whether or not TM achieves this throughput is a different matter).
Exactly 🙂 This is why, in #9330, I recommended including the transaction throughput rate in the transaction data. This allows us to easily correlate each transaction with the corresponding throughput rate for which the client was configured at the time.
I don't think we can achieve throughput similar to the ones reported in the Ethan's thesis, because they use a synthetic workload ("Transactions are preloaded on each validator") and they don't use the mempool ("all mempool activity is
disabled (no gossiping of transactions or rechecking them after commits)").
A synthetic workload is the best-case workload for a network protocol. Whenever the protocol (consensus) wants transactions to propose, the transactions are already there (in the case, in the mempool). There is no delay introduced by client-server communication, there is no queuing delay (the time a transactions sits in the mempool until it is proposed), there are no empty or partially filled blocks (i.e., size smaller than the desired), and there is no delay for clients learning decided blocks and transactions.
It is not clear, on the thesis, which parameters varies in order to have a graph with multiple points. I suspect that what varies is the number of transactions pre-loaded to the validators' mempools. But we can visualize in the graphs this concept of saturation workload: the point from which throughput starts not increasing by much, while latency starts deteriorating.
(up to some value that causes the latency to go asymptotic - this would be our "saturation point")
Not always latency goes "asymptotic", although observing this on the graph convinces anyone that the system is saturated, eheh. That's why we need something better than a visual representation of that.
Some authors use the concept of power = throughput / latency. This is not a metric, in the sense that the value of this ratio does not have much meaning, we are only interested in finding the point (experiment) with maximum power. The point with maximum power will usually correspond to the point in the graphs before latency goes asymptotic, using your words.
So, I got some raw results of our experiments with Tendermint with 128 validators, where we were searching for this saturation point. The raw data is the following, not very clear, but real data.
The first column is a parameter of the workload. I think it is the number of client threads per validator, I am not sure, but the point is: the higher, the greater the workload. The second column is throughput, in transactions per second, using 1KB transactions. The third is average transaction latency, in seconds. The fourth is the famous power, i.e., throughput / latency. The maximum power, for workload (first column) 12 is the data we reported in the paper:
Feel free to plot graphs with this data. For instance, 1:2 is throughput vs load, 1:3 is latency vs load, and 2:3 is latency vs throughput. You will find graphs that are not as nice as the graph we presented as results, or the one in Ethan's thesis. But this what we expect in real systems. Notice that with workload 32 we have the best throughput, if we only report this data we would consider this point. The cost of which, however, is latency 2.3 times larger than the latency in the saturation point (workload 12).
Notice also the strategy for finding this maximum power, that looks like a binary search. We first doubled the workload at each step, and got 4, 8, 16, 32. We realized that the maximum power should be between 8 and 16, so we tried 12. To be sure it was the maximum, we needed some points after 12 (13, 14).
There is a question that I didn't mention to you regarding the workload generation. There are essentially two kinds of client-produced workloads, following the closed-loop and the open-loop client model.
In our experiments with Tendermint we used closed-loop clients. This means that a client submits a transactions and wait until the transaction is committed, to then submit a new transaction. So, if the latency for a transaction is 2 seconds, a closed-loop client will propose 0.5 transactions per second. If the latency increases, a closed-loop client will slow down as well. This is a more realistic model, but with which is typically harder to push a protocol to its maximum throughput.
The proposal you have, submit 100 txs per second, assumes a open-loop clients. A client in this model submits transactions at a given rate, no matter how long it takes for a transaction to be committed. This is a little unrealistic, as a client will usually stop submitting new transactions when it realizes that none of the previously submitted ones were ordered. This method, however, is more suited to finding the highest throughput of a system, as it does not include any flow-control mechanism. At the same time, in order to find this maximum throughput, latency typically goes asymptotic. Of course, if a system can support a load of 100t txs/s, for instance, and you produce 150 txs/s, we have 50 per second that will sit in a queue waiting for the time they can be proposed, this queue will increase without any control and latency measurements will not make much sense, as you are measuring the time in the queue, not the time to order the transaction.
Implementing an open-loop client is easy, as you don't need to keep state and synchronize submitting transactions with delivering transactions, and I think we should adopt it. But we need to be sure that we are not producing more transactions than the system can support, otherwise the results will become useless.
Activity
williambanfield commentedon Aug 31, 2022
I'm trying to get a better handle on what's being asked for here. I'm not sure I understanding the following phrase:
@thanethomson could you provide some more concrete explanation of what such a calculation may look like?
thanethomson commentedon Aug 31, 2022
If you look at chapter 9 in Ethan's thesis, you'll see a bunch of graphs showing transaction throughput vs latency.
@cason please correct me if I'm wrong here, but my understanding of what we're doing is controlling the transaction throughput rate from the client's perspective while measuring transaction latency. In the paper, the aim was to measure raw Tendermint performance under non-adversarial conditions, but we're trying to get a sense of these metrics under "normal" operating conditions (i.e. with default timeout values, with mempool gossip enabled, in a large network).
So for example, we'd need to run the following "loads" of transactions into the system:
Where X could be some arbitrarily chosen value like 5 or 10 (i.e. run each test for 5 or 10 mins).
For each of those transaction throughput rates, we need to measure the transaction latency statistics. So for 100 txs/sec, we need min/max/avg/std. dev. latency; then for 200 txs/sec, we need min/max/avg/std. dev latency; etc.
If my understanding of our testing approach is correct, in a large network (175 validators), and if the current Tendermint implementation is comparable to the version in Ethan's thesis, we should expect the saturation point to be lower than 10k txs/sec.
williambanfield commentedon Aug 31, 2022
Ah, I see, so for each experimental load we generate, we want to generate the listed latency statistics. I was a bit caught on the word throughput. We're not actually generating throughput statistics, but statistics for each of the attempted throughputs we generate (whether or not TM achieves this throughput is a different matter).
Seems like a nice benchmark to start with.
thanethomson commentedon Aug 31, 2022
Exactly 🙂 This is why, in #9330, I recommended including the transaction throughput rate in the transaction data. This allows us to easily correlate each transaction with the corresponding throughput rate for which the client was configured at the time.
cason commentedon Sep 2, 2022
I don't think we can achieve throughput similar to the ones reported in the Ethan's thesis, because they use a synthetic workload ("Transactions are preloaded on each validator") and they don't use the mempool ("all mempool activity is
disabled (no gossiping of transactions or rechecking them after commits)").
A synthetic workload is the best-case workload for a network protocol. Whenever the protocol (consensus) wants transactions to propose, the transactions are already there (in the case, in the mempool). There is no delay introduced by client-server communication, there is no queuing delay (the time a transactions sits in the mempool until it is proposed), there are no empty or partially filled blocks (i.e., size smaller than the desired), and there is no delay for clients learning decided blocks and transactions.
It is not clear, on the thesis, which parameters varies in order to have a graph with multiple points. I suspect that what varies is the number of transactions pre-loaded to the validators' mempools. But we can visualize in the graphs this concept of saturation workload: the point from which throughput starts not increasing by much, while latency starts deteriorating.
cason commentedon Sep 2, 2022
Not always latency goes "asymptotic", although observing this on the graph convinces anyone that the system is saturated, eheh. That's why we need something better than a visual representation of that.
Some authors use the concept of power = throughput / latency. This is not a metric, in the sense that the value of this ratio does not have much meaning, we are only interested in finding the point (experiment) with maximum power. The point with maximum power will usually correspond to the point in the graphs before latency goes asymptotic, using your words.
cason commentedon Sep 2, 2022
So, I got some raw results of our experiments with Tendermint with 128 validators, where we were searching for this saturation point. The raw data is the following, not very clear, but real data.
The first column is a parameter of the workload. I think it is the number of client threads per validator, I am not sure, but the point is: the higher, the greater the workload. The second column is throughput, in transactions per second, using 1KB transactions. The third is average transaction latency, in seconds. The fourth is the famous power, i.e., throughput / latency. The maximum power, for workload (first column) 12 is the data we reported in the paper:
4 219.75 2.23047 98.521
8 342.882 2.87293 119.349
12 432.982 3.44704 125.609
13 424.665 3.78511 112.193
14 397.335 4.2664 93.131
16 392.612 4.9246 79.724
32 486.282 7.98602 60.891
Feel free to plot graphs with this data. For instance, 1:2 is throughput vs load, 1:3 is latency vs load, and 2:3 is latency vs throughput. You will find graphs that are not as nice as the graph we presented as results, or the one in Ethan's thesis. But this what we expect in real systems. Notice that with workload 32 we have the best throughput, if we only report this data we would consider this point. The cost of which, however, is latency 2.3 times larger than the latency in the saturation point (workload 12).
Notice also the strategy for finding this maximum power, that looks like a binary search. We first doubled the workload at each step, and got 4, 8, 16, 32. We realized that the maximum power should be between 8 and 16, so we tried 12. To be sure it was the maximum, we needed some points after 12 (13, 14).
cason commentedon Sep 2, 2022
There is a question that I didn't mention to you regarding the workload generation. There are essentially two kinds of client-produced workloads, following the closed-loop and the open-loop client model.
In our experiments with Tendermint we used closed-loop clients. This means that a client submits a transactions and wait until the transaction is committed, to then submit a new transaction. So, if the latency for a transaction is 2 seconds, a closed-loop client will propose 0.5 transactions per second. If the latency increases, a closed-loop client will slow down as well. This is a more realistic model, but with which is typically harder to push a protocol to its maximum throughput.
The proposal you have, submit 100 txs per second, assumes a open-loop clients. A client in this model submits transactions at a given rate, no matter how long it takes for a transaction to be committed. This is a little unrealistic, as a client will usually stop submitting new transactions when it realizes that none of the previously submitted ones were ordered. This method, however, is more suited to finding the highest throughput of a system, as it does not include any flow-control mechanism. At the same time, in order to find this maximum throughput, latency typically goes asymptotic. Of course, if a system can support a load of 100t txs/s, for instance, and you produce 150 txs/s, we have 50 per second that will sit in a queue waiting for the time they can be proposed, this queue will increase without any control and latency measurements will not make much sense, as you are measuring the time in the queue, not the time to order the transaction.
Implementing an open-loop client is easy, as you don't need to keep state and synchronize submitting transactions with delivering transactions, and I think we should adopt it. But we need to be sure that we are not producing more transactions than the system can support, otherwise the results will become useless.