-
Notifications
You must be signed in to change notification settings - Fork 14
Include maniftests that can run load with the benchmark pod for techempower and petclinic benchmark #71
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
Open
kusumachalasani
wants to merge
4
commits into
kruize:master
Choose a base branch
from
kusumachalasani:runtimes
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Include maniftests that can run load with the benchmark pod for techempower and petclinic benchmark #71
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,98 @@ | ||
| # 1. PetClinic Service: Fixed port 8081 and matching selectors | ||
| apiVersion: v1 | ||
| kind: Service | ||
| metadata: | ||
| name: petclinic-service | ||
| annotations: | ||
| prometheus.io/scrape: 'true' | ||
| prometheus.io/path: '/manage/prometheus' | ||
| labels: | ||
| app: petclinic-app | ||
| spec: | ||
| type: NodePort | ||
| ports: | ||
| - port: 8081 | ||
| targetPort: 8081 | ||
| nodePort: 32334 | ||
| name: petclinic-port | ||
| selector: | ||
| app: petclinic-deployment | ||
| --- | ||
| # 2. PetClinic Deployment: Updated with your specific image and labels | ||
| apiVersion: apps/v1 | ||
| kind: Deployment | ||
| metadata: | ||
| name: petclinic-sample | ||
| labels: | ||
| app: petclinic-app | ||
| spec: | ||
| replicas: 1 | ||
| selector: | ||
| matchLabels: | ||
| app: petclinic-deployment | ||
| template: | ||
| metadata: | ||
| labels: | ||
| name: petclinic-deployment | ||
| app: petclinic-deployment | ||
| app.kubernetes.io/name: "petclinic-deployment" | ||
| version: v1 | ||
| spec: | ||
| containers: | ||
| - name: petclinic-tomcat | ||
| image: quay.io/kruizehub/spring_petclinic:2.2.0-jdk-11.0.8-openj9-0.21.0 | ||
| imagePullPolicy: IfNotPresent | ||
| ports: | ||
| - containerPort: 8081 | ||
| volumeMounts: | ||
| - name: "test-volume" | ||
| mountPath: "/opt/jLogs" | ||
| # Readiness probe ensures the Load Job waits for the actual JVM to start | ||
| readinessProbe: | ||
| httpGet: | ||
| path: / | ||
| port: 8081 | ||
| initialDelaySeconds: 20 | ||
| periodSeconds: 10 | ||
| volumes: | ||
| - name: test-volume | ||
| emptyDir: {} | ||
| --- | ||
| # 3. JMeter Load Job: Coordinated to start only when Service is ready | ||
| apiVersion: batch/v1 | ||
| kind: Job | ||
| metadata: | ||
| name: petclinic-load-generator | ||
| spec: | ||
| template: | ||
| spec: | ||
| # Wait logic ensures JMeter doesn't fire into a void while Tomcat is booting | ||
| initContainers: | ||
| - name: wait-for-petclinic | ||
| image: busybox:1.28 | ||
| command: ['sh', '-c', "until nc -z petclinic-service 8081; do echo 'Waiting for PetClinic...'; sleep 2; done;"] | ||
| containers: | ||
| - name: petclinic-load | ||
| image: quay.io/kruizehub/spring_petclinic_load:jmeter_3.3 | ||
| command: ["/bin/sh", "-c"] | ||
| args: | ||
| - | | ||
| cd /jmeter/apache-jmeter-${JMETER_VERSION} | ||
|
|
||
| # STAGE 1: Low Load (50 Users) | ||
| echo "Starting Stage 1: 50 Users..." | ||
| ./bin/jmeter -n -t petclinic.jmx -Jduration=900 -Jusers=50 \ | ||
| -JPETCLINIC_HOST=petclinic-service -JPETCLINIC_PORT=8081 | ||
|
|
||
| # STAGE 2: Medium Load (100 Users) | ||
| echo "Starting Stage 2: 100 Users..." | ||
| ./bin/jmeter -n -t petclinic.jmx -Jduration=600 -Jusers=100 \ | ||
| -JPETCLINIC_HOST=petclinic-service -JPETCLINIC_PORT=8081 | ||
|
|
||
| # STAGE 3: Peak Load (150 Users) | ||
| echo "Starting Stage 3: 150 Users..." | ||
| ./bin/jmeter -n -t petclinic.jmx -Jduration=300 -Jusers=150 \ | ||
| -JPETCLINIC_HOST=petclinic-service -JPETCLINIC_PORT=8081 | ||
| restartPolicy: Never | ||
| backoffLimit: 2 | ||
|
|
||
14 changes: 14 additions & 0 deletions
14
spring-petclinic/manifests/kruize-demos/service-monitor.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| apiVersion: monitoring.coreos.com/v1 | ||
| kind: ServiceMonitor | ||
| metadata: | ||
| name: petclinic | ||
| labels: | ||
| team: petclinic-frontend | ||
| spec: | ||
| selector: | ||
| matchLabels: | ||
| app: petclinic-app | ||
sourcery-ai[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| endpoints: | ||
| - port: petclinic-port | ||
| path: '/manage/prometheus' | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| apiVersion: apps/v1 | ||
| kind: Deployment | ||
| metadata: | ||
| name: tfb-database | ||
| labels: | ||
| app: tfb-database | ||
| spec: | ||
| replicas: 1 | ||
| selector: | ||
| matchLabels: | ||
| app: tfb-database | ||
| template: | ||
| metadata: | ||
| labels: | ||
| name: tfb-database | ||
| app: tfb-database | ||
| # Add label to the application which is used by kruize/autotune to monitor it | ||
| app.kubernetes.io/name: "tfb-database" | ||
| version: v1 | ||
| spec: | ||
| containers: | ||
| - name: tfb-database | ||
| image: quay.io/kruizehub/tfb-postgres:openshift | ||
| imagePullPolicy: IfNotPresent | ||
| env: | ||
| - name: POSTGRESQL_USER | ||
| value: benchmarkdbuser | ||
| - name: POSTGRESQL_PASSWORD | ||
| value: benchmarkdbpass | ||
| - name: POSTGRESQL_DATABASE | ||
| value: hello_world | ||
| lifecycle: | ||
| postStart: | ||
| exec: | ||
| command: ["/bin/sh", "-c", "sleep 10 && psql -a hello_world < /tmp/create-postgres-data.sql"] | ||
| ports: | ||
| - containerPort: 5432 | ||
| resources: | ||
| requests: | ||
| cpu: 0.5 | ||
| memory: "512Mi" | ||
| limits: | ||
| cpu: 2 | ||
| memory: "1024Mi" | ||
| --- | ||
| apiVersion: v1 | ||
| kind: Service | ||
| metadata: | ||
| name: tfb-database | ||
| labels: | ||
| name: tfb-database | ||
| spec: | ||
| type: ClusterIP | ||
| selector: | ||
| app: tfb-database | ||
| ports: | ||
| - protocol: TCP | ||
| port: 5432 | ||
| targetPort: 5432 |
124 changes: 124 additions & 0 deletions
124
techempower/manifests/kruize-demos/quarkus-resteasy-hibernate.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,124 @@ | ||
| apiVersion: apps/v1 | ||
| kind: Deployment | ||
| metadata: | ||
| name: tfb-qrh-sample | ||
| labels: | ||
| app: tfb-qrh-app | ||
| spec: | ||
| replicas: 1 | ||
| selector: | ||
| matchLabels: | ||
| app: tfb-qrh-deployment | ||
| template: | ||
| metadata: | ||
| labels: | ||
| name: tfb-qrh-deployment | ||
| app: tfb-qrh-deployment | ||
| # Add label to the application which is used by kruize/autotune to monitor it | ||
| app.kubernetes.io/name: "tfb-qrh-deployment" | ||
| app.kubernetes.io/layer: "quarkus" | ||
| version: v1 | ||
| spec: | ||
| volumes: | ||
| - name: test-volume | ||
| emptyDir: {} | ||
| containers: | ||
| - name: tfb-server | ||
| image: quay.io/kruizehub/tfb-qrh:1.13.2.F_et17 | ||
| imagePullPolicy: IfNotPresent | ||
| env: | ||
| - name: "JAVA_OPTIONS" | ||
| value: "-server" | ||
| ports: | ||
| - containerPort: 8080 | ||
| resources: | ||
| requests: | ||
| cpu: 1.5 | ||
| memory: "512Mi" | ||
| limits: | ||
| cpu: 3.5 | ||
| memory: "2048Mi" | ||
| volumeMounts: | ||
| - name: "test-volume" | ||
| mountPath: "/opt/jLogs" | ||
| --- | ||
| apiVersion: batch/v1 | ||
| kind: Job | ||
| metadata: | ||
| name: tfb-qrh-load-generator | ||
| spec: | ||
| template: | ||
| spec: | ||
| terminationGracePeriodSeconds: 0 | ||
| # Wait for Quarkus to be ready before starting the load | ||
| initContainers: | ||
| - name: wait-for-tfb | ||
| image: busybox:1.28 | ||
| command: ['sh', '-c'] | ||
| args: | ||
| - | | ||
| echo "Waiting for TFB (/plaintext) to be ready..." | ||
| for i in $(seq 1 120); do | ||
| if wget -qO- http://tfb-qrh-service:8080/plaintext > /dev/null; then | ||
| echo "TFB is ready!" | ||
| exit 0 | ||
| fi | ||
| echo "Waiting for app... ($i/120)" | ||
| sleep 1 | ||
| done | ||
| echo "ERROR: TFB did not respond in 2 minutes." | ||
| exit 1 | ||
| containers: | ||
| - name: tfb-qrh-load | ||
| image: quay.io/kruizehub/tfb_hyperfoil_load:0.25.2 | ||
| env: | ||
| - name: TARGET | ||
| value: "tfb-qrh-service:8080" | ||
| command: ["/bin/sh", "-c"] | ||
| args: | ||
| - | | ||
| echo "Starting 30-minute Multi-Endpoint Benchmark..." | ||
|
|
||
| # --- PHASE 1: Combined Ramp-up (5 mins) --- | ||
| for conn in 50 150 300; do | ||
| echo "Ramping up: ${conn} connections..." | ||
| /opt/run_hyperfoil_load.sh $TARGET "plaintext" 30 12 $conn | ||
| /opt/run_hyperfoil_load.sh $TARGET "db" 30 12 $conn | ||
| /opt/run_hyperfoil_load.sh $TARGET "queries?queries=20" 40 12 $conn | ||
| done | ||
|
|
||
| # --- PHASE 2: Plaintext (CPU focus - 8 mins) --- | ||
| echo "Phase 2: High Throughput (Plaintext)..." | ||
| /opt/run_hyperfoil_load.sh $TARGET "plaintext" 480 12 400 | ||
|
|
||
| # --- PHASE 3: DB Query (Pool focus - 8 mins) --- | ||
| echo "Phase 3: DB Driver & Connection Pool..." | ||
| /opt/run_hyperfoil_load.sh $TARGET "db" 480 12 400 | ||
|
|
||
| # --- PHASE 4: Hibernate (Memory focus - 9 mins) --- | ||
| echo "Phase 4: Complex ORM & Memory Allocation..." | ||
| /opt/run_hyperfoil_load.sh $TARGET "queries?queries=20" 540 12 500 | ||
|
|
||
| echo "Full benchmark complete. Entering 2-minute cooldown..." | ||
| sleep 120 | ||
| restartPolicy: Never | ||
| backoffLimit: 1 | ||
|
|
||
| --- | ||
| apiVersion: v1 | ||
| kind: Service | ||
| metadata: | ||
| name: tfb-qrh-service | ||
| annotations: | ||
| prometheus.io/scrape: 'true' | ||
| prometheus.io/path: '/q/metrics' | ||
| labels: | ||
| app: tfb-qrh-app | ||
| spec: | ||
| type: NodePort | ||
| ports: | ||
| - port: 8080 | ||
| targetPort: 8080 | ||
| name: tfb-qrh-port | ||
| selector: | ||
| name: tfb-qrh-deployment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| apiVersion: monitoring.coreos.com/v1 | ||
| kind: ServiceMonitor | ||
| metadata: | ||
| name: tfb-qrh | ||
| labels: | ||
| team: tfb-qrh-frontend | ||
| spec: | ||
| selector: | ||
| matchLabels: | ||
| app: tfb-qrh-app | ||
| endpoints: | ||
| - port: tfb-qrh-port | ||
| path: '/q/metrics' |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kusumachalasani Can you update the benchmark readme to indicate that on using these manifests load is run internally