github.com/evdatsion/aphelion-dpos-bft@v0.32.1/tools/tm-bench/README.md (about) 1 # tm-bench 2 3 Tendermint blockchain benchmarking tool: 4 5 - [https://github.com/evdatsion/aphelion-dpos-bft/tree/master/tools/tm-bench](https://github.com/evdatsion/aphelion-dpos-bft/tree/master/tools/tm-bench) 6 7 For example, the following: `tm-bench -T 30 -r 10000 localhost:26657` 8 9 will output: 10 11 ``` 12 Stats Avg StdDev Max Total 13 Txs/sec 3981 1993 5000 119434 14 Blocks/sec 0.800 0.400 1 24 15 ``` 16 17 NOTE: **tm-bench only works with build-in `kvstore` ABCI application**. For it 18 to work with your application, you will need to modify `generateTx` function. 19 In the future, we plan to support scriptable transactions (see 20 [\#1938](https://github.com/evdatsion/aphelion-dpos-bft/issues/1938)). 21 22 ## Quick Start 23 24 ### Docker 25 26 ``` 27 docker run -it --rm -v "/tmp:t init 28 docker run -it --rm -v "/tmp::26657" --name=tm tendermint node --proore 29 30 docker run -it --rm --link=tm tendermint/bench tm:26657 31 ``` 32 33 ### Using binaries 34 35 [Install Tendermint](https://github.com/evdatsion/aphelion-dpos-bft#install) 36 37 then run: 38 39 ``` 40 tendermint init 41 tendermint node --proxy_app=kvstore 42 43 tm-bench localhost:26657 44 ``` 45 46 with the last command being in a separate window. 47 48 ## Usage 49 50 ``` 51 Tendermint blockchain benchmarking tool. 52 53 Usage: 54 tm-bench [-c 1] [-T 10] [-r 1000] [-s 250] [endpoints] [-output-format <plain|json> [-broadcast-tx-method <async|sync|commit>]] 55 56 Examples: 57 tm-bench localhost:26657 58 Flags: 59 -T int 60 Exit after the specified amount of time in seconds (default 10) 61 -broadcast-tx-method string 62 Broadcast method: async (no guarantees; fastest), sync (ensures tx is checked) or commit (ensures tx is checked and committed; slowest) (default "async") 63 -c int 64 Connections to keep open per endpoint (default 1) 65 -output-format string 66 Output format: plain or json (default "plain") 67 -r int 68 Txs per second to send in a connection (default 1000) 69 -s int 70 The size of a transaction in bytes, must be greater than or equal to 40. (default 250) 71 -v Verbose output 72 ``` 73 74 ## How stats are collected 75 76 These stats are derived by having each connection send transactions at the 77 specified rate (or as close as it can get) for the specified time. 78 After the specified time, it iterates over all of the blocks that were created 79 in that time. 80 The average and stddev per second are computed based off of that, by 81 grouping the data by second. 82 83 To send transactions at the specified rate in each connection, we loop 84 through the number of transactions. 85 If its too slow, the loop stops at one second. 86 If its too fast, we wait until the one second mark ends. 87 The transactions per second stat is computed based off of what ends up in the 88 block. 89 90 Note that there will be edge effects on the number of transactions in the first 91 and last blocks. 92 This is because transactions may start sending midway through when tendermint 93 starts building the next block, so it only has half as much time to gather txs 94 that tm-bench sends. 95 Similarly the end of the duration will likely end mid-way through tendermint 96 trying to build the next block. 97 98 Each of the connections is handled via two separate goroutines. 99 100 ## Development 101 102 ``` 103 make test 104 ```