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

#2383 - Horizontal Autoscaler from replication controller to deployment config #2485

Merged
merged 6 commits into from
Nov 15, 2023

Conversation

guru-aot
Copy link
Collaborator

@guru-aot guru-aot commented Nov 8, 2023

  • Horizontal autoscaler target needs to be changed from Replication controller to deployment config.
  • Apply the Horizontal autoscaler for the pods, change the deploy.yaml and apply them during the deployments.

Without HPA not properly assigned
image

With HPA properly assigned
image
image

Formio Load testing
WIth 2 pods it scaled up to 6 pods for 400 Vu
image
image
image

With 6 pods running the same sets of load for 400 Vu
image
image
image

With 6 pods running 300 Vu
image
image
image

With 6 pods running 200 Vu
image
image
image

With 6 pods running 100 Vu
image
image
image

With 2 pods running 100 Vu it started the 3rd pod
image
image
image

@guru-aot guru-aot self-assigned this Nov 8, 2023
@guru-aot guru-aot changed the title #2382 - Horizontal Autoscaler from replication controller to deployment config #2383 - Horizontal Autoscaler from replication controller to deployment config Nov 8, 2023
@guru-aot guru-aot marked this pull request as ready for review November 8, 2023 01:46
@guru-aot guru-aot added the Devops Devops label Nov 8, 2023
@andrewsignori-aot andrewsignori-aot marked this pull request as draft November 8, 2023 18:31
@guru-aot guru-aot marked this pull request as ready for review November 10, 2023 21:10
@@ -225,18 +225,30 @@ objects:
to:
kind: Service
name: ${NAME}
- apiVersion: autoscaling/v1
- apiVersion: autoscaling/v2
Copy link
Collaborator

Choose a reason for hiding this comment

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

👍

name: cpu
target:
type: AverageValue
averageValue: '0.18'
Copy link
Collaborator

Choose a reason for hiding this comment

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

Asking for my clarification, how did we arrive at this average value?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

90% of the CPU limit

name: memory
target:
type: AverageValue
averageValue: "230M"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

90% of the Memory limit

name: memory
target:
type: AverageValue
averageValue: "1Gi"
Copy link
Collaborator

Choose a reason for hiding this comment

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

I see higher numbers for form.io server than API for autoscaling, is this with consideration that form.io server is going to have lighter load than API?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No, the averageValue is a percentage of the CPU and memory limits and here for formio, we have used the 50% as we used in the previous load testing iterations, this inturn helps for pods scaling without many requests failing.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Got it. Thanks for explaining. If 50% then cpu must be 0.75 ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah you are right, i did increased a bit and tested around so gave those value.

Copy link
Collaborator

@dheepak-aot dheepak-aot left a comment

Choose a reason for hiding this comment

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

Great job 👍

Copy link
Collaborator

@andrepestana-aot andrepestana-aot left a comment

Choose a reason for hiding this comment

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

Looks good! Good job!

Copy link
Collaborator

@andrewsignori-aot andrewsignori-aot left a comment

Choose a reason for hiding this comment

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

Great work. Just one really minor comment.
Let's talk about extending or having a second ticket to implement the scaleDown behavior if needed.
Besides that, once deployed I would like to see the API autoscaling load test 😉

Copy link
Contributor

@ann-aot ann-aot left a comment

Choose a reason for hiding this comment

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

👍 Thanks for the details

Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

Copy link

Backend Unit Tests Coverage Report

Totals Coverage
Statements: 19.99% ( 2612 / 13065 )
Methods: 10.43% ( 173 / 1658 )
Lines: 22.78% ( 2252 / 9887 )
Branches: 12.3% ( 187 / 1520 )

Copy link

E2E Workflow Workers Coverage Report

Totals Coverage
Statements: 52.62% ( 341 / 648 )
Methods: 50% ( 40 / 80 )
Lines: 56.85% ( 282 / 496 )
Branches: 26.39% ( 19 / 72 )

Copy link

E2E Queue Consumers Coverage Report

Totals Coverage
Statements: 76.94% ( 564 / 733 )
Methods: 71.59% ( 63 / 88 )
Lines: 78.75% ( 493 / 626 )
Branches: 42.11% ( 8 / 19 )

Copy link

E2E SIMS API Coverage Report

Totals Coverage
Statements: 55.08% ( 4064 / 7379 )
Methods: 51.98% ( 499 / 960 )
Lines: 59.83% ( 3298 / 5512 )
Branches: 29.44% ( 267 / 907 )

Copy link
Collaborator

@andrewsignori-aot andrewsignori-aot left a comment

Choose a reason for hiding this comment

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

Thanks for doing the changes, looks good 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Devops Devops
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants