Measure the performance of new transaction pool implementation, this measurement should give us constants which can be defined as default transaction pool processing capability.
With the implementation of a new transaction pool, we need to measure the performance of transaction processing capability to identify the constants for optimal utilization of our transaction pool.
- maxTransactions: 4096
- maxTransactionsPerAccount: 64
It would be better to conduct this research write after we implement the priority queue so that we identify if there are any bottlenecks to processing transactions.
| | |
|---|---|
| VPS Provide | Digital Ocean |
| OS | Linux 18.04.3 LTS x 64 |
| Processor | 1 CPU |
| Memory | 1 GB |
| Storage | 25GB SSD|
| NodeJS | v12.13.1 |
| PostgreSQL | 10.12 |
| Network | devnet |
| Build Type | Source |
| Branch | release/4.0.0 |
Step 1
forging: { force: true }Step 2
forging: { force: false } so it does not forge any block, as we just need to measure the performance of a transaction pool. Step 3
Step 4
maxTransactions configuration of the transaction pool.[ 1024, 2048, 3072, 4096, 5120, 6144, 7168, 8192, 9216, 10240 ]
maxTransactionsPerAcount configuration of the transaction pool.[ 16, 32, 48, 64, 80, 96, 112, 128, 144, 160, 176, 192, 208, 224, 240, 256, 272, 288, 304, 320, 336, 352, 368, 384, 400, 416, 432, 448, 464, 480, 496, 512 ]
maxTransactions and then benchmarked it against each value of maxTransactionsPerAcounttxPool.getAll.stop() to first stop processing, and then removed every transaction with help of txPool.getAll() and txPool.remove(). And then started the pool with txPool.getAll.start()txPool.getProcessableTransactions() every 50ms. 15kb payload of transactions, we stopped the pool. Recorded the time and configuration and then repeat the whole process with the next configuration value. The raw data can be found on the below link.
https://gist.github.com/nazarhussain/356ba6012b5aac324d94b63a5230ff94
For clarity, we plotted some of the values here on this graph.

maxTransactionsPerAccount value the performance is increased. maxTransactions performed well for lower values of maxTransactionsPerAccount, but overall trend lines show the same. maxTransations performed badly compared to lower values. 392698 transactions in the transaction pool. 110-115 transfer transactions made up to 15kb. The current configuration of (4096, 64) provides roughly 2300 ms average, which is good enough considering the 10s block time.
We can achieve more performance if we decrease the max number of transactions to 2048 and per account limit to 48, the performance increase here will be rough 30ms - 50ms, which is not that significant.
So I suggest keeping the current configurations as it is and if we observe something special in beta net phase, we can decrease these values. And if we observe high traffic volume, we can increase the values as well with some understanding from the above graph how much performance will be decreased.
@ManuGowda @shuse2 Please look into the above findings and details and share your feedback.
Great job =)
We have concluded that the current default parameter is good with the current setup.
Most helpful comment
Benchmark Environment
| | |
|---|---|
| VPS Provide | Digital Ocean |
| OS | Linux 18.04.3 LTS x 64 |
| Processor | 1 CPU |
| Memory | 1 GB |
| Storage | 25GB SSD|
| NodeJS | v12.13.1 |
| PostgreSQL | 10.12 |
| Network | devnet |
| Build Type | Source |
| Branch | release/4.0.0 |
Benchmark Process
Step 1
forging: { force: true }Step 2
forging: { force: false }so it does not forge any block, as we just need to measure the performance of a transaction pool.Step 3
Step 4
maxTransactionsconfiguration of the transaction pool.maxTransactionsPerAcountconfiguration of the transaction pool.maxTransactionsand then benchmarked it against each value ofmaxTransactionsPerAcounttxPool.getAll.stop()to first stop processing, and then removed every transaction with help oftxPool.getAll()andtxPool.remove(). And then started the pool withtxPool.getAll.start()txPool.getProcessableTransactions()every 50ms.15kbpayload of transactions, we stopped the pool. Recorded the time and configuration and then repeat the whole process with the next configuration value.Benchmark Data
The raw data can be found on the below link.
https://gist.github.com/nazarhussain/356ba6012b5aac324d94b63a5230ff94
For clarity, we plotted some of the values here on this graph.
Observations
maxTransactionsPerAccountvalue the performance is increased.maxTransactionsperformed well for lower values ofmaxTransactionsPerAccount, but overall trend lines show the same.maxTransationsperformed badly compared to lower values.392698transactions in the transaction pool.110-115transfer transactions made up to15kb.Conclusions
The current configuration of
(4096, 64)provides roughly2300 msaverage, which is good enough considering the10sblock time.We can achieve more performance if we decrease the max number of transactions to
2048and per account limit to48, the performance increase here will be rough30ms - 50ms, which is not that significant.So I suggest keeping the current configurations as it is and if we observe something special in beta net phase, we can decrease these values. And if we observe high traffic volume, we can increase the values as well with some understanding from the above graph how much performance will be decreased.