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

Add task for setting up an autoscaler for a site #302

Merged
merged 1 commit into from
May 3, 2024

Conversation

hypesystem
Copy link
Contributor

@hypesystem hypesystem commented May 3, 2024

What does this PR do?

The autoscaler handles scaling the nginx pod (which runs php and nginx) for a particular site.

This means that we will automatically scale to more instances if the system reaches higher load. Makes it less likely for us to encounter downtime when we go live with sites.

The current utilizations are set based on the (for now hard-coded from lagoon's side) resource requests for the pod. As the pod only requests 110 Mi memory, we set the bar for scaling up very high (500% of request -> 550 Mi). We are in talks with Amazee about enabling changes to the resource requests but it is not currently possible.

The autoscaler has been deployed on canary, herlev, billund and kobenhavn.

Should this be tested by the reviewer and how?

Run the script for a site, e.g. customizable-canary, and verify that a horizontalpodautoscaler is created in the correct namespace.

If you really want to test it, tweak the scaling metric (e.g. set averageUtilization: 50 for the memory-metric) to see the autoscaler in action.

What are the relevant tickets?

DDFDRIFT-87

The autoscaler handles scaling the nginx pod (which runs php and nginx) for a particular site.
Copy link
Contributor

@achton achton left a comment

Choose a reason for hiding this comment

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

Very nice work! Tested and LGTM 👍🏻

@hypesystem hypesystem merged commit 1b0fa2c into main May 3, 2024
2 checks passed
@hypesystem hypesystem deleted the php-nginx-autoscaler branch May 3, 2024 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants