1. It is recommended to bring some performance optimization parameters
when starting the rpc node, which can avoid problems such as slow node synchronization blocks. The specific parameters are as follows:
Note that after upgrading to v0.19.17.2, the parameters are as follows:
- For nodes started in binary form, add the following parameters to the exchaind start command:
--max-open=10000
--disable-abci-query-mutex=1
--fast-query=1
--enable-bloom-filter=1
--mempool.size=10000
--mempool.recheck=0
--mempool.force_recheck_gap=2000
--iavl-cache-size=1000000
- For nodes started in docker mode, add the following parameters to the docker run command:
--env OKEXCHAIN_MAX_OPEN=10000
--env OKEXCHAIN_DISABLE_ABCI_QUERY_MUTEX=1
--env OKEXCHAIN_FAST_QUERY=1
--env OKEXCHAIN_ENABLE_BLOOM_FILTER=1
--env OKEXCHAIN_MEMPOOL_SIZE=10000
--env OKEXCHAIN_MEMPOOL_RECHECK=0
--env OKEXCHAIN_MEMPOOL_FORCE_RECHECK_GAP=2000
--env OKEXCHAIN_IAVL_CACHE_SIZE=1000000
The configuration before version v0.19.17.2, the parameters are as follows
- For nodes started in binary form, add the following parameters to the exchaind start command:
--max-open=10000
--close-mutex=1
--fast-query=1
--enable-bloom-filter=1
--mempool.size=10000
--mempool.recheck=0
--mempool.force_recheck_gap=2000
--iavl-cache-size=1000000
- For nodes started in docker mode, add the following parameters to the docker run command:
--env OKEXCHAIN_MAX_OPEN=10000
--env OKEXCHAIN_CLOSE_MUTEX=1
--env OKEXCHAIN_FAST_QUERY=1
--env OKEXCHAIN_ENABLE_BLOOM_FILTER=1
--env OKEXCHAIN_MEMPOOL_SIZE=10000
--env OKEXCHAIN_MEMPOOL_RECHECK=0
--env OKEXCHAIN_MEMPOOL_FORCE_RECHECK_GAP=2000
--env OKEXCHAIN_IAVL_CACHE_SIZE=1000000
2. Explanation of the meaning of performance parameters
- --max-open=10000 The maximum number of connections, the default value is 1000, increasing this value can provide the number of connections that the rpc service can receive.
- --disable-abci-query-mutex=1 (--close-mutex=1 used before v0.19.17.2 has been deprecated) The lock switch in abci query, the default value is false, it can be improved after changing to true query performance
- --fast-query=1 Fast query mode switch, the default value is off, and the query data will be additionally recorded to watch.db after opening, improving query performance
- --enable-bloom-filter=1 bloom filter switch, the default value is off, turning it on can improve the query performance of eth_getLogs_
- --mempool.size=10000 Set the mempool size, the default value is 2000, increasing this value can improve the storage in the mempool
tx amount.
- --mempool.recheck=0 Set the mempool recheck switch, the default value is on, and turning it off can reduce the performance consumed by recheck
- --mempool.force_recheck_gap=2000 Set the number of block intervals for mempool to force recheck, the default value is 200, increasing this value can reduce recheck
The number of times can improve performance, but setting too large may cause a backlog of too many invalid transactions in the mempool.
- --iavl-cache-size=1000000 Set the iavl tree cache size, the default value is 1000000, increasing this value can reduce disk reads and improve execution speed, but it will take up more memory, which can be adjusted according to the actual memory usage of the machine.
- --pruning=everything/nothing. For detailed configuration of pruning parameters, please view
Latest Solution
After the exchain version is upgraded to v0.19.17.2, you can use the node mode method to simplify the node parameter configuration. When starting the rpc node, bring the --node-mode=rpc parameter. Refer to: https://forum.okt.club/d/388-node-type-node-mode-parameter-configuration-instructions