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] Read-Only transaction support #1229

Merged
merged 17 commits into from
Jun 6, 2023
Merged

[PH] Read-Only transaction support #1229

merged 17 commits into from
Jun 6, 2023

Conversation

oschwaldp-oci
Copy link
Contributor

@oschwaldp-oci oschwaldp-oci commented Jun 5, 2023

  • Mode Support: API Node (HTTP Node)
    • Create support for read-only transactions in the http transaction generator
    • Use existing "payloadless" test contract with read-only action defined
  • New config options
    • --api-nodes-read-only-threads - "API nodes read only threads count for use with read-only transactions", default=0
    • api-endpoint -- "The api endpoint to direct transactions to. Defaults to: '/v1/chain/send_transaction2'" (Specified in the user-trx-data-file)
  • Add performance load test with read-only trxs

Resolves: #783

…pcoming additions including specifying actual api endpoints for use.
Previously it was leaving the empty placeholder in the map which made it trigger the map as non empty and do unnecessary work in the generator.
…nfig.

Add configuration option for api-endpoint to allow targeting specific http endpoint with transactions.

Configurable number of read-only threads for the api nodes.

Allow for empty authorizations in transaction action for read-only trx support.
Add apiEndpoint and userTrxData to test report for reference.

Simplify createReport argument list.
@oschwaldp-oci oschwaldp-oci requested a review from heifner June 5, 2023 18:47
@heifner heifner added the OCI Work exclusive to OCI team label Jun 5, 2023
tests/trx_generator/trx_provider.hpp Outdated Show resolved Hide resolved
tests/trx_generator/trx_provider.hpp Outdated Show resolved Hide resolved
tests/trx_generator/trx_provider.cpp Outdated Show resolved Hide resolved
tests/trx_generator/trx_provider.cpp Outdated Show resolved Hide resolved
tests/trx_generator/trx_provider.cpp Outdated Show resolved Hide resolved
tests/trx_generator/trx_provider.hpp Outdated Show resolved Hide resolved
tests/trx_generator/trx_provider.hpp Outdated Show resolved Hide resolved
tests/trx_generator/trx_provider.hpp Outdated Show resolved Hide resolved
tests/trx_generator/trx_provider.hpp Outdated Show resolved Hide resolved
@oschwaldp-oci oschwaldp-oci requested review from ScottBailey and linh2931 and removed request for ScottBailey June 6, 2023 15:27
Copy link
Member

@linh2931 linh2931 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In addition to read-only trxs, we run read-only Chain APIs like get_info, get_block, ... on the read-only threads. It would be nice to have a performance test of mixture of them. But that can be a separate task.

In \"p2p\" mode transactions will be directed to the p2p endpoint on a producer node. \
In \"http\" mode transactions will be directed to the http endpoint on an api node.",
choices=["p2p", "http"], default="p2p")
parser.add_argument("endpoint_api_type", type=str, help="Endpoint API mode (\"p2p\", \"http\"). \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think API here is confusing. Why not just Endpoint mode?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed: a8f559c

@@ -15,21 +16,25 @@ endif()

add_test(NAME performance_test_bp COMMAND tests/performance_tests/performance_test.py testBpOpMode --max-tps-to-test 50 --test-iteration-min-step 10 --test-iteration-duration-sec 10 --final-iterations-duration-sec 10 --calc-chain-threads lmax overrideBasicTestConfig -v --tps-limit-per-generator 25 --chain-state-db-size-mb 200 ${UNSHARE} WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
add_test(NAME performance_test_api COMMAND tests/performance_tests/performance_test.py testApiOpMode --max-tps-to-test 50 --test-iteration-min-step 10 --test-iteration-duration-sec 10 --final-iterations-duration-sec 10 --calc-chain-threads lmax overrideBasicTestConfig -v --tps-limit-per-generator 25 --chain-state-db-size-mb 200 ${UNSHARE} WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
add_test(NAME performance_test_ro COMMAND tests/performance_tests/performance_test.py testApiOpMode --max-tps-to-test 50 --test-iteration-min-step 10 --test-iteration-duration-sec 10 --final-iterations-duration-sec 10 overrideBasicTestConfig -v --tps-limit-per-generator 25 --api-nodes-read-only-threads 2 --account-name "payloadless" --abi-file payloadless.abi --wasm-file payloadless.wasm --contract-dir unittests/test-contracts/payloadless --user-trx-data-file tests/performance_tests/readOnlyTrxData.json --chain-state-db-size-mb 200 ${UNSHARE} WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can expand the name performance_test_ro to performance_test_read_only_trxs

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed: a8f559c

add_test(NAME performance_test_basic_ex_transfer_trx_spec COMMAND tests/performance_tests/performance_test_basic.py -v --producer-nodes 1 --validation-nodes 1 --target-tps 20 --tps-limit-per-generator 10 --test-duration-sec 5 --chain-state-db-size-mb 200 --user-trx-data-file tests/performance_tests/userTrxDataTransfer.json ${UNSHARE} WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
add_test(NAME performance_test_basic_ex_new_acct_trx_spec COMMAND tests/performance_tests/performance_test_basic.py -v --producer-nodes 1 --validation-nodes 1 --target-tps 20 --tps-limit-per-generator 10 --test-duration-sec 5 --chain-state-db-size-mb 200 --user-trx-data-file tests/performance_tests/userTrxDataNewAccount.json ${UNSHARE} WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
add_test(NAME performance_test_basic_ex_cpu_trx_spec COMMAND tests/performance_tests/performance_test_basic.py -v --producer-nodes 1 --validation-nodes 1 --target-tps 20 --tps-limit-per-generator 10 --test-duration-sec 5 --chain-state-db-size-mb 200 --account-name "c" --abi-file eosmechanics.abi --wasm-file eosmechanics.wasm --contract-dir unittests/contracts/eosio.mechanics --user-trx-data-file tests/performance_tests/cpuTrxData.json ${UNSHARE} WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
add_test(NAME performance_test_basic_ex_ram_trx_spec COMMAND tests/performance_tests/performance_test_basic.py -v --producer-nodes 1 --validation-nodes 1 --target-tps 20 --tps-limit-per-generator 10 --test-duration-sec 5 --chain-state-db-size-mb 200 --account-name "r" --abi-file eosmechanics.abi --wasm-file eosmechanics.wasm --contract-dir unittests/contracts/eosio.mechanics --user-trx-data-file tests/performance_tests/ramTrxData.json ${UNSHARE} WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
add_test(NAME performance_test_basic_ex_read_only_trxs COMMAND tests/performance_tests/performance_test_basic.py -v --endpoint-api-type http --producer-nodes 1 --validation-nodes 1 --api-nodes 1 --api-nodes-read-only-threads 2 --target-tps 20 --tps-limit-per-generator 10 --test-duration-sec 5 --chain-state-db-size-mb 200 --account-name "payloadless" --abi-file payloadless.abi --wasm-file payloadless.wasm --contract-dir unittests/test-contracts/payloadless --user-trx-data-file tests/performance_tests/readOnlyTrxData.json ${UNSHARE} WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does ex mean here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Honestly, it's been long enough I can't remember if it was example or execute. Regardless, could probably be removed and just have, for instance, performance_test_basic_read_only_trxs.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed: a8f559c

Rename and simplify test naming for clarity.
Rename endpoint api type to simply be endpoint mode for clarity.
@oschwaldp-oci oschwaldp-oci merged commit 6ad3081 into main Jun 6, 2023
@oschwaldp-oci oschwaldp-oci deleted the ph-read-only-trxs branch June 6, 2023 21:25
@linh2931 linh2931 restored the ph-read-only-trxs branch September 14, 2023 01:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCI Work exclusive to OCI team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add performance load test with read-only trxs
3 participants