diff --git a/docker-compose-perf.yml b/docker-compose-perf.yml index df8a0f9d..717439e5 100644 --- a/docker-compose-perf.yml +++ b/docker-compose-perf.yml @@ -1015,6 +1015,9 @@ services: interval: 30s sim-perffsp1: + sysctls: + # websockets do not have keep-alive, resulting in many TIME_WAIT sockets + net.ipv4.tcp_tw_reuse: 1 image: mojaloop/callback-handler-svc:${TEST_CALLBACK_HAND_SVC_VERSION} deploy: mode: replicated @@ -1051,6 +1054,9 @@ services: - 8dfsp sim-perffsp2: + sysctls: + # websockets do not have keep-alive, resulting in many TIME_WAIT sockets + net.ipv4.tcp_tw_reuse: 1 image: mojaloop/callback-handler-svc:${TEST_CALLBACK_HAND_SVC_VERSION} # deploy: # mode: replicated @@ -1087,6 +1093,9 @@ services: - 8dfsp sim-perffsp3: + sysctls: + # websockets do not have keep-alive, resulting in many TIME_WAIT sockets + net.ipv4.tcp_tw_reuse: 1 image: mojaloop/callback-handler-svc:${TEST_CALLBACK_HAND_SVC_VERSION} deploy: mode: replicated @@ -1119,6 +1128,9 @@ services: - 8dfsp sim-perffsp4: + sysctls: + # websockets do not have keep-alive, resulting in many TIME_WAIT sockets + net.ipv4.tcp_tw_reuse: 1 image: mojaloop/callback-handler-svc:${TEST_CALLBACK_HAND_SVC_VERSION} deploy: mode: replicated @@ -1151,6 +1163,9 @@ services: - 8dfsp sim-perffsp5: + sysctls: + # websockets do not have keep-alive, resulting in many TIME_WAIT sockets + net.ipv4.tcp_tw_reuse: 1 image: mojaloop/callback-handler-svc:${TEST_CALLBACK_HAND_SVC_VERSION} deploy: mode: replicated @@ -1182,6 +1197,9 @@ services: - 8dfsp sim-perffsp6: + sysctls: + # websockets do not have keep-alive, resulting in many TIME_WAIT sockets + net.ipv4.tcp_tw_reuse: 1 image: mojaloop/callback-handler-svc:${TEST_CALLBACK_HAND_SVC_VERSION} deploy: mode: replicated @@ -1213,6 +1231,9 @@ services: - 8dfsp sim-perffsp7: + sysctls: + # websockets do not have keep-alive, resulting in many TIME_WAIT sockets + net.ipv4.tcp_tw_reuse: 1 image: mojaloop/callback-handler-svc:${TEST_CALLBACK_HAND_SVC_VERSION} deploy: mode: replicated @@ -1244,6 +1265,9 @@ services: - 8dfsp sim-perffsp8: + sysctls: + # websockets do not have keep-alive, resulting in many TIME_WAIT sockets + net.ipv4.tcp_tw_reuse: 1 image: mojaloop/callback-handler-svc:${TEST_CALLBACK_HAND_SVC_VERSION} deploy: mode: replicated diff --git a/packages/k6-tests/common/uuid.js b/packages/k6-tests/common/uuid.js index 378dec8a..7e346459 100644 --- a/packages/k6-tests/common/uuid.js +++ b/packages/k6-tests/common/uuid.js @@ -1,6 +1,9 @@ import { randomString } from 'https://jslib.k6.io/k6-utils/1.2.0/index.js'; const random = len => randomString(len, '0123456789abcdef') +// This is not a standard compliant UUID v7, as some of the services do not allow it. +// Additionally there are not UUID v7 modules that can be easily used in k6, so this simple iplementation +// is used instead export function uuid() { const t = Date.now().toString(16).padStart(12, 0); return `${t.substring(0,8)}-${t.substring(8,12)}-4${random(3)}-9${random(3)}-${random(12)}` diff --git a/packages/k6-tests/config/fspiopDiscovery.json b/packages/k6-tests/config/fspiopDiscovery.json index 3f0294b3..1039368b 100644 --- a/packages/k6-tests/config/fspiopDiscovery.json +++ b/packages/k6-tests/config/fspiopDiscovery.json @@ -9,8 +9,8 @@ "startVUs": 5, "stages": [ { "duration": "30s", "target": 600 }, - { "duration": "1m", "target": 1000 }, - { "duration": "2m", "target": 1000 } + { "duration": "1m", "target": 5000 }, + { "duration": "1h", "target": 5000 } ] } }, diff --git a/packages/k6-tests/config/fspiopDiscoveryRampingRate.json b/packages/k6-tests/config/fspiopDiscoveryRampingRate.json index f7f24937..dd560128 100644 --- a/packages/k6-tests/config/fspiopDiscoveryRampingRate.json +++ b/packages/k6-tests/config/fspiopDiscoveryRampingRate.json @@ -1,20 +1,25 @@ { "scenarios": { - "fspiopTransfers": { + "fspiopDiscovery": { "executor": "ramping-arrival-rate", "exec": "fspiopDiscoveryScenarios", "env": { "UNIDIRECTIONAL": "false" }, - "preAllocatedVUs": 50, + "preAllocatedVUs": 1000, "timeUnit": "1s", "startRate": 10, "stages": [ - { "target": 100, "duration": "30s" }, - { "target": 200, "duration": "30s" }, - { "target": 300, "duration": "30s" }, - { "target": 300, "duration": "5m" } - + { "target": 200, "duration": "15s" }, + { "target": 200, "duration": "3m" }, + { "target": 400, "duration": "15s" }, + { "target": 400, "duration": "3m" }, + { "target": 600, "duration": "15s" }, + { "target": 600, "duration": "3m" }, + { "target": 800, "duration": "15s" }, + { "target": 800, "duration": "3m" }, + { "target": 1000, "duration": "15s" }, + { "target": 1000, "duration": "3m" } ] } }, diff --git a/packages/k6-tests/config/fspiopE2E.json b/packages/k6-tests/config/fspiopE2E.json index ebc432be..45d8685c 100644 --- a/packages/k6-tests/config/fspiopE2E.json +++ b/packages/k6-tests/config/fspiopE2E.json @@ -8,8 +8,9 @@ }, "startVUs": 1, "stages": [ - { "duration": "30s", "target": 30 }, - { "duration": "5m", "target": 30 } + { "duration": "30s", "target": 600 }, + { "duration": "1m", "target": 5000 }, + { "duration": "2h", "target": 5000 } ] } }, diff --git a/packages/k6-tests/config/fspiopQuotesRampingRate.json b/packages/k6-tests/config/fspiopQuotesRampingRate.json new file mode 100644 index 00000000..cc31f37a --- /dev/null +++ b/packages/k6-tests/config/fspiopQuotesRampingRate.json @@ -0,0 +1,31 @@ +{ + "scenarios": { + "fspiopQuotes": { + "executor": "ramping-arrival-rate", + "exec": "fspiopQuotesScenarios", + "env": { + "UNIDIRECTIONAL": "false" + }, + "preAllocatedVUs": 1000, + "timeUnit": "1s", + "startRate": 10, + "stages": [ + { "target": 200, "duration": "15s" }, + { "target": 200, "duration": "3m" }, + { "target": 400, "duration": "15s" }, + { "target": 400, "duration": "3m" }, + { "target": 600, "duration": "15s" }, + { "target": 600, "duration": "3m" }, + { "target": 800, "duration": "15s" }, + { "target": 800, "duration": "3m" }, + { "target": 1000, "duration": "15s" }, + { "target": 1000, "duration": "3m" } + ] + } + }, + "thresholds": { + "iteration_duration": [ "p(95)<1000" ], + "http_req_failed": [ "rate<0.01" ], + "http_req_duration": [ "p(95)<1000" ] + } +} diff --git a/packages/k6-tests/config/fspiopTransfersRampingRate.json b/packages/k6-tests/config/fspiopTransfersRampingRate.json index e2e84e8a..5b25676d 100644 --- a/packages/k6-tests/config/fspiopTransfersRampingRate.json +++ b/packages/k6-tests/config/fspiopTransfersRampingRate.json @@ -6,13 +6,20 @@ "env": { "UNIDIRECTIONAL": "false" }, - "preAllocatedVUs": 50, + "preAllocatedVUs": 1000, "timeUnit": "1s", "startRate": 10, "stages": [ - { "target": 100, "duration": "5m" }, - { "target": 200, "duration": "5m" }, - { "target": 300, "duration": "10m" } + { "target": 200, "duration": "15s" }, + { "target": 200, "duration": "3m" }, + { "target": 400, "duration": "15s" }, + { "target": 400, "duration": "3m" }, + { "target": 600, "duration": "15s" }, + { "target": 600, "duration": "3m" }, + { "target": 800, "duration": "15s" }, + { "target": 800, "duration": "3m" }, + { "target": 1000, "duration": "15s" }, + { "target": 1000, "duration": "3m" } ] } }, diff --git a/patch.sh b/patch.sh index ef23de31..e1b61ba1 100755 --- a/patch.sh +++ b/patch.sh @@ -1,7 +1,8 @@ #!/bin/sh -kubectl patch deployment --kubeconfig k8s.yaml --namespace mojaloop moja-centralledger-service --patch-file patch/ledger-service.yaml -sleep 10 # wait for schema creation -kubectl scale --kubeconfig k8s.yaml --namespace mojaloop deployment/moja-centralledger-service --replicas=8 +# kubectl patch deployment --kubeconfig k8s.yaml --namespace mojaloop moja-centralledger-service --patch-file patch/ledger-service.yaml +# sleep 10 # wait for schema creation +# kubectl scale --kubeconfig k8s.yaml --namespace mojaloop deployment/moja-centralledger-service --replicas=8 +kubectl patch deployment --kubeconfig k8s.yaml --namespace mojaloop moja-account-lookup-service --patch-file patch/account-service.yaml kubectl patch deployment --kubeconfig k8s.yaml --namespace mojaloop moja-ml-api-adapter-service --patch-file patch/adapter-service.yaml kubectl patch deployment --kubeconfig k8s.yaml --namespace mojaloop moja-ml-api-adapter-handler-notification --patch-file patch/adapter-handler.yaml kubectl patch deployment --kubeconfig k8s.yaml --namespace mojaloop moja-centralledger-handler-admin-transfer --patch-file patch/transfer-admin.yaml diff --git a/patch/account-service.yaml b/patch/account-service.yaml new file mode 100644 index 00000000..651842e6 --- /dev/null +++ b/patch/account-service.yaml @@ -0,0 +1,12 @@ +spec: + replicas: 12 + template: + spec: + containers: + - name: account-lookup-service + image: mojaloop/account-lookup-service:v15.2.4 + env: + - name: EVENT_SDK_LOG_FILTER + value: '' + - name: EVENT_SDK_SIDECAR_DISABLED + value: 'true' diff --git a/patch/quoting-handler.yaml b/patch/quoting-handler.yaml index 816ef612..17f301b2 100644 --- a/patch/quoting-handler.yaml +++ b/patch/quoting-handler.yaml @@ -4,7 +4,7 @@ spec: spec: containers: - name: quoting-service-handler - image: mojaloop/quoting-service:v15.7.1-snapshot.0 + image: mojaloop/quoting-service:v15.7.1 env: - name: EVENT_SDK_LOG_FILTER value: '' diff --git a/patch/quoting-service.yaml b/patch/quoting-service.yaml index 4fe16805..3b6b4f1a 100644 --- a/patch/quoting-service.yaml +++ b/patch/quoting-service.yaml @@ -4,7 +4,7 @@ spec: spec: containers: - name: quoting-service - image: mojaloop/quoting-service:v15.7.1-snapshot.0 + image: mojaloop/quoting-service:v15.7.1 env: - name: EVENT_SDK_LOG_FILTER value: '' diff --git a/test.sh b/perf-test.sh similarity index 80% rename from test.sh rename to perf-test.sh index 788a2a7b..1436418f 100755 --- a/test.sh +++ b/perf-test.sh @@ -11,6 +11,10 @@ discoveries) echo "Testing account discoveries" env K6_SCRIPT_CONFIG_FILE_NAME=fspiopDiscovery.json docker compose --project-name load -f docker-compose-load.yml up -d ;; +discoveriesrate) + echo "Testing account discoveries with constant rates" + env K6_SCRIPT_CONFIG_FILE_NAME=fspiopDiscoveryRampingRate.json docker compose --project-name load -f docker-compose-load.yml up -d +;; quote) echo "Testing single quote" env K6_SCRIPT_CONFIG_FILE_NAME=fspiopSingleQuote.json docker compose --project-name load -f docker-compose-load.yml up @@ -19,14 +23,22 @@ quotes) echo "Testing quotes" env K6_SCRIPT_CONFIG_FILE_NAME=fspiopQuotes.json docker compose --project-name load -f docker-compose-load.yml up -d ;; +quotesrate) + echo "Testing quotes" + env K6_SCRIPT_CONFIG_FILE_NAME=fspiopQuotesRampingRate.json docker compose --project-name load -f docker-compose-load.yml up -d +;; transfer) echo "Testing single transfer" env K6_SCRIPT_CONFIG_FILE_NAME=fspiopSingleTransfer.json docker compose --project-name load -f docker-compose-load.yml up ;; -transfer) +transfers) echo "Testing transfers" env K6_SCRIPT_CONFIG_FILE_NAME=fspiopTransfers.json docker compose --project-name load -f docker-compose-load.yml up -d ;; +transfersrate) + echo "Testing transfers" + env K6_SCRIPT_CONFIG_FILE_NAME=fspiopTransfersRampingRate.json docker compose --project-name load -f docker-compose-load.yml up -d +;; e2e) echo "Testing multiple end to end" env K6_SCRIPT_CONFIG_FILE_NAME=fspiopE2E.json docker compose --project-name load -f docker-compose-load.yml up -d @@ -52,6 +64,7 @@ simrestart) echo "Usage: " echo " $0 discovery" echo " $0 discoveries" + echo " $0 discoveries rate" echo " $0 quote" echo " $0 quotes" echo " $0 transfer"