You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

108 lines
3.3 KiB

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