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.

79 lines
2.0 KiB

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