Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PH] Expose various Nodeos Options in performance_test_basic #740

11 changes: 9 additions & 2 deletions tests/TestHarness/Cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,15 @@ def launch(self, pnodes=1, unstartedNodes=0, totalNodes=1, prodCount=1, topo="me
cmdArr=cmd.split()
if self.staging:
cmdArr.append("--nogen")

nodeosArgs="--max-transaction-time -1 --abi-serializer-max-time-ms 990000 --p2p-max-nodes-per-host %d --max-clients %d" % (maximumP2pPerHost, maximumClients)
nodeosArgs=""
if extraNodeosArgs.find("--max-transaction-time") == -1:
nodeosArgs += " --max-transaction-time -1"
if extraNodeosArgs.find("--abi-serializer-max-time-ms") == -1:
nodeosArgs += " --abi-serializer-max-time-ms 990000"
if extraNodeosArgs.find("--p2p-max-nodes-per-host") == -1:
nodeosArgs += f" --p2p-max-nodes-per-host {maximumP2pPerHost}"
if extraNodeosArgs.find("--max-clients") == -1:
nodeosArgs += f" --max-clients {maximumClients}"
oschwaldp-oci marked this conversation as resolved.
Show resolved Hide resolved
if not self.walletd:
nodeosArgs += " --plugin eosio::wallet_api_plugin"
if Utils.Debug:
Expand Down
38 changes: 34 additions & 4 deletions tests/performance_tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,6 @@ The Performance Harness main script `performance_test.py` can be configured usin
(default: 2)
* `--signature-cpu-billable-pct SIGNATURE_CPU_BILLABLE_PCT`
Percentage of actual signature recovery cpu to bill. Whole number percentages, e.g. 50 for 50% (default: 0)
* `--chain-state-db-size-mb CHAIN_STATE_DB_SIZE_MB`
Maximum size (in MiB) of the chain state database (default: 10240)
* `--chain-threads CHAIN_THREADS`
Number of worker threads in controller thread pool (default: 3)
* `--database-map-mode {mapped,heap,locked}`
Expand Down Expand Up @@ -279,6 +277,23 @@ The Performance Harness main script `performance_test.py` can be configured usin
* `--contract-dir` Path to contract dir
* `--wasm-file` WASM file name for contract
* `--abi-file` ABI file name for contract
* `--wasm-runtime RUNTIME`
Override default WASM runtime ("eos-vm-jit", "eos-vm")
"eos-vm-jit" : A WebAssembly runtime that compiles WebAssembly code to native x86 code prior to
execution. "eos-vm" : A WebAssembly interpreter. (default: eos-vm-jit)
* `--contracts-console` print contract's output to console (default: False)
* `--eos-vm-oc-cache-size-mb CACHE_SIZE_MiB`
Maximum size (in MiB) of the EOS VM OC code cache (default: 1024)
* `--eos-vm-oc-compile-threads COMPILE_THREADS`
Number of threads to use for EOS VM OC tier-up (default: 1)
* `--eos-vm-oc-enable`
Enable EOS VM OC tier-up runtime (default: False)
* `--block-log-retain-blocks BLOCKS_TO_RETAIN`
If set to greater than 0, periodically prune the block log to
store only configured number of most recent blocks. If set to 0, no blocks are be written to the block log;
block log file is removed after startup. (default: None)
* `--http-threads HTTP_THREADS`
Number of worker threads in http thread pool (default: 2)
</details>

### Support Scripts
Expand Down Expand Up @@ -314,8 +329,6 @@ The following scripts are typically used by the Performance Harness main script
of the range of blocks of interest for evaluation. (default: 2)
* `--signature-cpu-billable-pct SIGNATURE_CPU_BILLABLE_PCT`
Percentage of actual signature recovery cpu to bill. Whole number percentages, e.g. 50 for 50% (default: 0)
* `--chain-state-db-size-mb CHAIN_STATE_DB_SIZE_MB`
Maximum size (in MiB) of the chain state database (default: 10240)
* `--chain-threads CHAIN_THREADS`
Number of worker threads in controller thread pool (default: 3)
* `--database-map-mode {mapped,heap,locked}`
Expand Down Expand Up @@ -352,6 +365,23 @@ The following scripts are typically used by the Performance Harness main script
* `--contract-dir` Path to contract dir
* `--wasm-file` WASM file name for contract
* `--abi-file` ABI file name for contract
* `--wasm-runtime RUNTIME`
Override default WASM runtime ("eos-vm-jit", "eos-vm")
"eos-vm-jit" : A WebAssembly runtime that compiles WebAssembly code to native x86 code prior to
execution. "eos-vm" : A WebAssembly interpreter. (default: eos-vm-jit)
* `--contracts-console` print contract's output to console (default: False)
* `--eos-vm-oc-cache-size-mb CACHE_SIZE_MiB`
Maximum size (in MiB) of the EOS VM OC code cache (default: 1024)
* `--eos-vm-oc-compile-threads COMPILE_THREADS`
Number of threads to use for EOS VM OC tier-up (default: 1)
* `--eos-vm-oc-enable`
Enable EOS VM OC tier-up runtime (default: False)
* `--block-log-retain-blocks BLOCKS_TO_RETAIN`
If set to greater than 0, periodically prune the block log to
store only configured number of most recent blocks. If set to 0, no blocks are be written to the block log;
block log file is removed after startup. (default: None)
* `--http-threads HTTP_THREADS`
Number of worker threads in http thread pool (default: 2)
</details>

#### Launch Transaction Generators (TestHarness)
Expand Down
27 changes: 20 additions & 7 deletions tests/performance_tests/performance_test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,6 @@ def createBaseArgumentParser():
ptbBaseParserGroup.add_argument("--num-blocks-to-prune", type=int, help=("The number of potentially non-empty blocks, in addition to leading and trailing size 0 blocks, "
"to prune from the beginning and end of the range of blocks of interest for evaluation."), default=2)
ptbBaseParserGroup.add_argument("--signature-cpu-billable-pct", type=int, help="Percentage of actual signature recovery cpu to bill. Whole number percentages, e.g. 50 for 50%%", default=0)
ptbBaseParserGroup.add_argument("--chain-state-db-size-mb", type=int, help="Maximum size (in MiB) of the chain state database", default=10*1024)
ptbBaseParserGroup.add_argument("--chain-threads", type=int, help="Number of worker threads in controller thread pool", default=2)
ptbBaseParserGroup.add_argument("--database-map-mode", type=str, help="Database map mode (\"mapped\", \"heap\", or \"locked\"). \
In \"mapped\" mode database is memory mapped as a file. \
Expand Down Expand Up @@ -557,6 +556,18 @@ def createBaseArgumentParser():
ptbBaseParserGroup.add_argument("--contract-dir", type=str, help="Path to contract dir", default="unittests/contracts/eosio.system")
ptbBaseParserGroup.add_argument("--wasm-file", type=str, help="WASM file name for contract", default="eosio.system.wasm")
ptbBaseParserGroup.add_argument("--abi-file", type=str, help="ABI file name for contract", default="eosio.system.abi")
ptbBaseParserGroup.add_argument("--wasm-runtime", type=str, help="Override default WASM runtime (\"eos-vm-jit\", \"eos-vm\")\
\"eos-vm-jit\" : A WebAssembly runtime that compiles WebAssembly code to native x86 code prior to\
execution. \"eos-vm\" : A WebAssembly interpreter.", default="eos-vm-jit")
oschwaldp-oci marked this conversation as resolved.
Show resolved Hide resolved
ptbBaseParserGroup.add_argument("--contracts-console", type=bool, help="print contract's output to console", default=False)
ptbBaseParserGroup.add_argument("--eos-vm-oc-cache-size-mb", type=int, help="Maximum size (in MiB) of the EOS VM OC code cache", default=1024)
ptbBaseParserGroup.add_argument("--eos-vm-oc-compile-threads", type=int, help="Number of threads to use for EOS VM OC tier-up", default=1)
ptbBaseParserGroup.add_argument("--eos-vm-oc-enable", type=bool, help="Enable EOS VM OC tier-up runtime", default=False)
oschwaldp-oci marked this conversation as resolved.
Show resolved Hide resolved
ptbBaseParserGroup.add_argument("--block-log-retain-blocks", type=int, help="If set to greater than 0, periodically prune the block log to\
store only configured number of most recent blocks. If set to 0, no blocks are be written to the block log;\
block log file is removed after startup.", default=None)
ptbBaseParserGroup.add_argument("--http-threads", type=int, help="Number of worker threads in http thread pool", default=2)
oschwaldp-oci marked this conversation as resolved.
Show resolved Hide resolved

return ptbBaseParser

@staticmethod
Expand All @@ -580,6 +591,8 @@ def createArgumentParser():
def parseArgs():
ptbParser=PtbArgumentsHandler.createArgumentParser()
args=ptbParser.parse_args()
if args.contracts_console:
print("Enabling contracts-console will not print anything unless debug level is 'debug' or higher.")
oschwaldp-oci marked this conversation as resolved.
Show resolved Hide resolved
return args

def main():
Expand All @@ -590,8 +603,7 @@ def main():
testHelperConfig = PerformanceTestBasic.TestHelperConfig(killAll=args.clean_run, dontKill=args.leave_running, keepLogs=not args.del_perf_logs,
dumpErrorDetails=args.dump_error_details, delay=args.d, nodesFile=args.nodes_file, verbose=args.v)

chainPluginArgs = ChainPluginArgs(signatureCpuBillablePct=args.signature_cpu_billable_pct, chainStateDbSizeMb=args.chain_state_db_size_mb,
chainThreads=args.chain_threads, databaseMapMode=args.database_map_mode)
chainPluginArgs = ChainPluginArgs(chainThreads=args.chain_threads, databaseMapMode=args.database_map_mode, abiSerializerMaxTimeMs=990000, chainStateDbSizeMb=256000)
oschwaldp-oci marked this conversation as resolved.
Show resolved Hide resolved

lbto = args.last_block_time_offset_us
lbcep = args.last_block_cpu_effort_percent
Expand All @@ -602,11 +614,12 @@ def main():
producerPluginArgs = ProducerPluginArgs(disableSubjectiveBilling=args.disable_subjective_billing,
lastBlockTimeOffsetUs=lbto, produceTimeOffsetUs=args.produce_time_offset_us,
cpuEffortPercent=args.cpu_effort_percent, lastBlockCpuEffortPercent=lbcep,
producerThreads=args.producer_threads)
httpPluginArgs = HttpPluginArgs(httpMaxResponseTimeMs=args.http_max_response_time_ms)
netPluginArgs = NetPluginArgs(netThreads=args.net_threads)
producerThreads=args.producer_threads, maxTransactionTime=-1)
httpPluginArgs = HttpPluginArgs(httpMaxBytesInFlightMb=-1, httpMaxResponseTimeMs=-1)
oschwaldp-oci marked this conversation as resolved.
Show resolved Hide resolved
netPluginArgs = NetPluginArgs(netThreads=args.net_threads, maxClients=0)
resourceMonitorPluginArgs = ResourceMonitorPluginArgs(resourceMonitorNotShutdownOnThresholdExceeded=True)
ENA = PerformanceTestBasic.ClusterConfig.ExtraNodeosArgs
extraNodeosArgs = ENA(chainPluginArgs=chainPluginArgs, httpPluginArgs=httpPluginArgs, producerPluginArgs=producerPluginArgs, netPluginArgs=netPluginArgs)
extraNodeosArgs = ENA(chainPluginArgs=chainPluginArgs, httpPluginArgs=httpPluginArgs, producerPluginArgs=producerPluginArgs, netPluginArgs=netPluginArgs, resourceMonitorPluginArgs=resourceMonitorPluginArgs)
SC = PerformanceTestBasic.ClusterConfig.SpecifiedContract
specifiedContract=SC(accountName=args.account_name, ownerPublicKey=args.owner_public_key, activePublicKey=args.active_public_key,
contractDir=args.contract_dir, wasmFile=args.wasm_file, abiFile=args.abi_file)
Expand Down