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.

80 lines
2.4 KiB

  1. # tm-bench
  2. Tendermint blockchain benchmarking tool:
  3. - https://github.com/tendermint/tools/tree/master/tm-bench
  4. For example, the following:
  5. tm-bench -T 10 -r 1000 localhost:26657
  6. will output:
  7. Stats Avg StdDev Max Total
  8. Txs/sec 818 532 1549 9000
  9. Blocks/sec 0.818 0.386 1 9
  10. ## Quick Start
  11. [Install Tendermint](https://github.com/tendermint/tendermint#install)
  12. This currently is setup to work on tendermint's develop branch. Please ensure
  13. you are on that. (If not, update `tendermint` and `tmlibs` in gopkg.toml to use
  14. the master branch.)
  15. then run:
  16. tendermint init
  17. tendermint node --proxy_app=kvstore
  18. tm-bench localhost:26657
  19. with the last command being in a seperate window.
  20. ## Usage
  21. tm-bench [-c 1] [-T 10] [-r 1000] [-s 250] [endpoints]
  22. Examples:
  23. tm-bench localhost:26657
  24. Flags:
  25. -T int
  26. Exit after the specified amount of time in seconds (default 10)
  27. -c int
  28. Connections to keep open per endpoint (default 1)
  29. -r int
  30. Txs per second to send in a connection (default 1000)
  31. -s int
  32. Size per tx in bytes
  33. -v Verbose output
  34. ## How stats are collected
  35. These stats are derived by having each connection send transactions at the
  36. specified rate (or as close as it can get) for the specified time.
  37. After the specified time, it iterates over all of the blocks that were created
  38. in that time.
  39. The average and stddev per second are computed based off of that, by
  40. grouping the data by second.
  41. To send transactions at the specified rate in each connection, we loop
  42. through the number of transactions.
  43. If its too slow, the loop stops at one second.
  44. If its too fast, we wait until the one second mark ends.
  45. The transactions per second stat is computed based off of what ends up in the
  46. block.
  47. Note that there will be edge effects on the number of transactions in the first
  48. and last blocks.
  49. This is because transactions may start sending midway through when tendermint
  50. starts building the next block, so it only has half as much time to gather txs
  51. that tm-bench sends.
  52. Similarly the end of the duration will likely end mid-way through tendermint
  53. trying to build the next block.
  54. Each of the connections is handled via two separate goroutines.
  55. ## Development
  56. make get_vendor_deps
  57. make test