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

Fix perf run scripts #1801

Merged
merged 1 commit into from
Oct 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 29 additions & 3 deletions test/performance/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ helm3 install apk-perftest -n apk-perf-test .
1. Navigate to `<APK_HOME>test/performance/artifacts/` and create the API:

```bash
kubectl -n apk-performance apply -f .
kubectl -n apk-perf-test apply -f .
```
Note: If you want to use a custom keystore.jks file other than `APK_HOME/test/performance/keystore.jks` then update the `APK_HOME/test/performance/artifacts/custom-jwt-cm.yaml` with the correct public key.

Expand All @@ -75,7 +75,7 @@ Note: If you want to use a custom keystore.jks file other than `APK_HOME/test/pe
Execute the following command to determine the private IP of the gateway load balancer:

```bash
IP=$(kubectl get svc apk-test-setup-wso2-apk-router-service -n apk-integration-test --output jsonpath='{.status.loadBalancer.ingress[0].ip}')
IP=$(kubectl get svc apk-perftest-wso2-apk-gateway-service -n apk-perf-test --output jsonpath='{.status.loadBalancer.ingress[0].ip}')
# Note: IP should be within the range of your subnet addresses.
```

Expand All @@ -96,6 +96,32 @@ Before setting up the JMeter servers, ensure the following prerequisites are met
- JMeter version 5.5 - Install JMeter on all three servers by downloading and extracting the JMeter package in the {$HOME} directory.
- kubectl 1.27 or higher
- jq
- login to az cluster

Run following commands in JMeter VMs;

```bash
sudo apt install openjdk-11-jre-headless
sudo snap install kubectl --classic
wget https://archive.apache.org/dist/jmeter/binaries/apache-jmeter-5.5.tgz
tar -xvzf apache-jmeter-5.5.tgz apache-jmeter-5.5
sudo apt install jq

cd apache-jmeter-5.5/bin/
mkdir payloads
chmod 755 payloads
cd
git clone https://github.com/wso2/apk
cd apk/test/performance/jwt-tokens/
./generate-jwt-tokens.sh -t 10000 -c 1234
cd
cp apk/test/performance/payloads/ apache-jmeter-5.5/bin/ -r
sudo nano /etc/hosts
# add <IP> default.gw.wso2.com
sudo apt install azure-cli
az login
#connect to cluster
```


### Generate Custom JWT Tokens
Expand All @@ -106,7 +132,7 @@ Follow these steps in all three jmeter servers

```bash
git clone https://github.com/wso2/apk
cd apk/test/performance/JwtTokens
cd apk/test/performance/jwt-tokens/
```

2. [Optional] If needed, replace `<APK_HOME>test/performance/jwt-tokens/keystore.jks` with your keystore file.
Expand Down
2 changes: 1 addition & 1 deletion test/performance/apk-test.jmx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
</ThreadGroup>
<hashTree>
<CSVDataSet guiclass="TestBeanGUI" testclass="CSVDataSet" testname="Tokens" enabled="true">
<stringProp name="filename">${__P(tokens_path,/home/azureuser/apk-load-testing/jwt-tokens/target/jwt-tokens-500.csv)}</stringProp>
<stringProp name="filename">${__P(tokens_path,/home/azureuser/apk/jwt-tokens/target/jwt-tokens-500.csv)}</stringProp>
<stringProp name="fileEncoding"></stringProp>
<stringProp name="variableNames">token</stringProp>
<stringProp name="delimiter">,</stringProp>
Expand Down
2 changes: 1 addition & 1 deletion test/performance/run-jmeter.sh
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ echo "Users per server: ${user_count_per_server}"
echo "${duration}"
set -x
cd "${HOME}/apache-jmeter-5.5/bin"
./jmeter -n -t ${HOME}/apk-load-testing/jmeter/apim-test.jmx \
./jmeter -n -t ${HOME}/apk/test/performance/apk-test.jmx \
-j "${results_dir}/jmeter.log" \
-Gusers="$user_count_per_server" \
-Gduration="$duration" \
Expand Down