lotus/cmd/lotus-bench
Fridrik Asmundsson 78d7ccd391 Add new RPC stress testing tool (lotus-bench rpc) with rich reporting
This benchmark is designed to stress test the rpc methods of a lotus node so that we can simulate real world usage and measure the performance of rpc methods on the node.

This benchmark has the following features:
* Can query each method both sequentially and concurrently
* Supports rate limiting
* Can query multiple different endpoints at once (supporting different concurrency level and rate limiting for each method)
* Gives a nice reporting summary of the stress testing of each method (including latency distribution, histogram and more)
* Easy to use

To use this benchmark you must specify the rpc methods you want to test using the --method options, the format of it is:

  --method=NAME[:CONCURRENCY][:QPS][:PARAMS] where only METHOD is required.

Here are some real examples:
  lotus-bench rpc --method='eth_chainId' // run eth_chainId with default concurrency and qps
  lotus-bench rpc --method='eth_chainId:3'  // override concurrency to 3
  lotus-bench rpc --method='eth_chainId::100' // override to 100 qps while using default concurrency
  lotus-bench rpc --method='eth_chainId:3:100' // run using 3 workers but limit to 100 qps
  lotus-bench rpc --method='eth_getTransactionCount:::["0xd4c70007F3F502f212c7e6794b94C06F36173B36", "latest"]' // run using optional params while using default concurrency and qps
  lotus-bench rpc --method='eth_chainId' --method='eth_getTransactionCount:10:0:["0xd4c70007F3F502f212c7e6794b94C06F36173B36", "latest"]' // run multiple methods at once`,

Fixes: https://github.com/filecoin-project/lotus/issues/10752
2023-05-27 10:55:10 +00:00
..
caching_verifier.go storage: Cleanup interfaces a bit 2022-06-17 13:52:19 +02:00
import.go refactor: stop using deprecated io/ioutil 2023-03-29 15:40:49 -04:00
main.go Add new RPC stress testing tool (lotus-bench rpc) with rich reporting 2023-05-27 10:55:10 +00:00
rpc.go Add new RPC stress testing tool (lotus-bench rpc) with rich reporting 2023-05-27 10:55:10 +00:00
simple.go refactor: stop using deprecated io/ioutil 2023-03-29 15:40:49 -04:00
stats_test.go fix make gen 2022-08-29 16:25:30 +02:00