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

13 changes: 10 additions & 3 deletions tests/TestHarness/Cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,11 +257,18 @@ 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 "--max-transaction-time" not in extraNodeosArgs:
nodeosArgs += " --max-transaction-time -1"
if "--abi-serializer-max-time-ms" not in extraNodeosArgs:
nodeosArgs += " --abi-serializer-max-time-ms 990000"
if "--p2p-max-nodes-per-host" not in extraNodeosArgs:
nodeosArgs += f" --p2p-max-nodes-per-host {maximumP2pPerHost}"
if "--max-clients" not in extraNodeosArgs:
nodeosArgs += f" --max-clients {maximumClients}"
if not self.walletd:
nodeosArgs += " --plugin eosio::wallet_api_plugin"
if Utils.Debug:
if Utils.Debug and "--contracts-console" not in extraNodeosArgs:
nodeosArgs += " --contracts-console"
if PFSetupPolicy.hasPreactivateFeature(pfSetupPolicy):
nodeosArgs += " --plugin eosio::producer_api_plugin"
Expand Down
48 changes: 42 additions & 6 deletions tests/performance_tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,6 @@ Performance Test Basic Base:
(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: 2)
* `--database-map-mode {mapped,heap,locked}`
Expand All @@ -284,7 +282,10 @@ Performance Test Basic Base:
* `--producer-threads PRODUCER_THREADS`
Number of worker threads in producer thread pool (default: 2)
* `--http-max-response-time-ms HTTP_MAX_RESPONSE_TIME_MS`
Maximum time for processing a request, -1 for unlimited (default: 990000)
Maximum time for processing a request, -1 for unlimited (default: -1)
* `--http-max-bytes-in-flight-mb HTTP_MAX_IN_FLIGHT_BYTES`
Maximum size in megabytes http_plugin should use for processing http requests. -1 for unlimited.
429 error response when exceeded. (default: -1)
* `--del-perf-logs` Whether to delete performance test specific logs. (default: False)
* `--del-report` Whether to delete overarching performance run report. (default: False)
* `--quiet` Whether to quiet printing intermediate results and reports to stdout (default: False)
Expand All @@ -298,6 +299,23 @@ Performance Test Basic Base:
Path to contract dir (default: unittests/contracts/eosio.system)
* `--wasm-file WASM_FILE` WASM file name for contract (default: eosio.system.wasm)
* `--abi-file ABI_FILE` ABI file name for contract (default: eosio.system.abi)
* `--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)
* `--non-prods-eos-vm-oc-enable`
Enable EOS VM OC tier-up runtime on non producer nodes (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)

Performance Harness:
Performance Harness testing configuration items.
Expand Down Expand Up @@ -371,8 +389,6 @@ Performance Test Basic Base:
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: 2)
* `--database-map-mode {mapped,heap,locked}`
Expand All @@ -399,7 +415,10 @@ Performance Test Basic Base:
* `--producer-threads PRODUCER_THREADS`
Number of worker threads in producer thread pool (default: 2)
* `--http-max-response-time-ms HTTP_MAX_RESPONSE_TIME_MS`
Maximum time for processing a request, -1 for unlimited (default: 990000)
Maximum time for processing a request, -1 for unlimited (default: -1)
* `--http-max-bytes-in-flight-mb HTTP_MAX_IN_FLIGHT_BYTES`
Maximum size in megabytes http_plugin should use for processing http requests. -1 for unlimited.
429 error response when exceeded. (default: -1)
* `--del-perf-logs` Whether to delete performance test specific logs. (default: False)
* `--del-report` Whether to delete overarching performance run report. (default: False)
* `--quiet` Whether to quiet printing intermediate results and reports to stdout (default: False)
Expand All @@ -414,6 +433,23 @@ Performance Test Basic Base:
* `--wasm-file WASM_FILE`
WASM file name for contract (default: eosio.system.wasm)
* `--abi-file ABI_FILE` ABI file name for contract (default: eosio.system.abi)
* `--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)
* `--non-prods-eos-vm-oc-enable`
Enable EOS VM OC tier-up runtime on non producer nodes (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)

Performance Test Basic Single Test:
Performance Test Basic single test configuration items. Useful for running a single test directly. These items may not be directly configurable from
Expand Down
21 changes: 14 additions & 7 deletions tests/performance_tests/performance_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from pathlib import Path, PurePath
sys.path.append(str(PurePath(PurePath(Path(__file__).absolute()).parent).parent))

from NodeosPluginArgs import ChainPluginArgs, HttpPluginArgs, NetPluginArgs, ProducerPluginArgs
from NodeosPluginArgs import ChainPluginArgs, HttpPluginArgs, NetPluginArgs, ProducerPluginArgs, ResourceMonitorPluginArgs
from TestHarness import TestHelper, Utils, Account
from performance_test_basic import PerformanceTestBasic, PtbArgumentsHandler
from platform import release, system
Expand Down Expand Up @@ -498,15 +498,22 @@ def main():
verbose=args.v)

ENA = PerformanceTestBasic.ClusterConfig.ExtraNodeosArgs
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(signatureCpuBillablePct=args.signature_cpu_billable_pct,
chainThreads=args.chain_threads, databaseMapMode=args.database_map_mode,
wasmRuntime=args.wasm_runtime, contractsConsole=args.contracts_console,
eosVmOcCacheSizeMb=args.eos_vm_oc_cache_size_mb, eosVmOcCompileThreads=args.eos_vm_oc_compile_threads,
blockLogRetainBlocks=args.block_log_retain_blocks,
abiSerializerMaxTimeMs=990000, chainStateDbSizeMb=256000)
producerPluginArgs = ProducerPluginArgs(disableSubjectiveBilling=args.disable_subjective_billing,
lastBlockTimeOffsetUs=args.last_block_time_offset_us, produceTimeOffsetUs=args.produce_time_offset_us,
cpuEffortPercent=args.cpu_effort_percent, lastBlockCpuEffortPercent=args.last_block_cpu_effort_percent,
producerThreads=args.producer_threads)
httpPluginArgs = HttpPluginArgs(httpMaxResponseTimeMs=args.http_max_response_time_ms)
netPluginArgs = NetPluginArgs(netThreads=args.net_threads)
extraNodeosArgs = ENA(chainPluginArgs=chainPluginArgs, httpPluginArgs=httpPluginArgs, producerPluginArgs=producerPluginArgs, netPluginArgs=netPluginArgs)
producerThreads=args.producer_threads, maxTransactionTime=-1)
httpPluginArgs = HttpPluginArgs(httpMaxResponseTimeMs=args.http_max_response_time_ms, httpMaxBytesInFlightMb=args.http_max_bytes_in_flight_mb,
httpThreads=args.http_threads)
netPluginArgs = NetPluginArgs(netThreads=args.net_threads, maxClients=0)
resourceMonitorPluginArgs = ResourceMonitorPluginArgs(resourceMonitorNotShutdownOnThresholdExceeded=True)
extraNodeosArgs = ENA(chainPluginArgs=chainPluginArgs, httpPluginArgs=httpPluginArgs, producerPluginArgs=producerPluginArgs, netPluginArgs=netPluginArgs,
resourceMonitorPluginArgs=resourceMonitorPluginArgs)
testClusterConfig = PerformanceTestBasic.ClusterConfig(pnodes=args.p, totalNodes=args.n, topo=args.s, genesisPath=args.genesis,
prodsEnableTraceApi=args.prods_enable_trace_api, extraNodeosArgs=extraNodeosArgs,
specifiedContract=PerformanceTestBasic.ClusterConfig.SpecifiedContract(account=Account(args.account_name),
Expand Down
Loading