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

perf: Reduce Memory Usage from the InstanceType Provider #5318

Merged
merged 1 commit into from
Dec 15, 2023

Conversation

engedaam
Copy link
Contributor

@engedaam engedaam commented Dec 13, 2023

Fixes #5196, #5225

Description

  • Clearing out the cache for the instance types provider on expired items.
  • Save items based on the EC2NodeClass resolution instead of EC2Nodeclass UUID

E2E Integration Periodic Run
Memory Utilization
Screenshot 2023-12-14 at 4 08 27 PM

CPU Utilization
Screenshot 2023-12-14 at 5 20 22 PM

E2E Integration with PR Run
Memory Utilization
Screenshot 2023-12-14 at 9 09 01 PM

CPU Utilization
Screenshot 2023-12-14 at 9 14 07 PM

  • E2E integration was used comparing the memory usage

How was this change tested?

  • /karpenter snapshot

Does this change impact docs?

  • Yes, PR includes docs updates
  • Yes, issue opened: #
  • No

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@engedaam engedaam requested a review from a team as a code owner December 13, 2023 18:00
Copy link

netlify bot commented Dec 13, 2023

Deploy Preview for karpenter-docs-prod canceled.

Name Link
🔨 Latest commit 72a42ef
🔍 Latest deploy log https://app.netlify.com/sites/karpenter-docs-prod/deploys/657baa7f5d903a00088ea020

@engedaam engedaam changed the title fix: Memory increase perf: Reduce Memory Usage from the InstanceType Provider Dec 13, 2023
Copy link
Contributor Author

@engedaam engedaam left a comment

Choose a reason for hiding this comment

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

/karpenter snapshot

@coveralls
Copy link

coveralls commented Dec 13, 2023

Pull Request Test Coverage Report for Build 7216708555

  • 9 of 9 (100.0%) changed or added relevant lines in 1 file are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage decreased (-0.005%) to 82.536%

Files with Coverage Reduction New Missed Lines %
pkg/providers/amifamily/ami.go 1 90.32%
Totals Coverage Status
Change from base Build 7216670424: -0.005%
Covered Lines: 4953
Relevant Lines: 6001

💛 - Coveralls

Copy link
Contributor

Snapshot successfully published to "oci://071440425669.ecr.us-east-1.amazonaws.com/karpenter/snapshot/karpenter:v0-ef9cec15ffd88b66770c3c63c624d02c1f1a4e82".

Copy link
Contributor Author

@engedaam engedaam left a comment

Choose a reason for hiding this comment

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

/karpenter scale

Copy link
Contributor

Snapshot successfully published to "oci://071440425669.ecr.us-east-1.amazonaws.com/karpenter/snapshot/karpenter:v0-ef9cec15ffd88b66770c3c63c624d02c1f1a4e82".

@engedaam engedaam force-pushed the fix-memory-incress branch 2 times, most recently from eb3b1e7 to a6fec62 Compare December 13, 2023 22:20
Copy link
Contributor Author

@engedaam engedaam left a comment

Choose a reason for hiding this comment

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

/karpenter snapshot

Copy link
Contributor

Snapshot successfully published to "oci://071440425669.ecr.us-east-1.amazonaws.com/karpenter/snapshot/karpenter:v0-a6fec625dc1f11740de68a9e9e2cdf50e0087b7e".

@engedaam engedaam force-pushed the fix-memory-incress branch 2 times, most recently from 9a834cf to 9fc32f2 Compare December 14, 2023 00:14
Copy link
Contributor Author

@engedaam engedaam left a comment

Choose a reason for hiding this comment

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

/karpenter snapshot

Copy link
Contributor

Snapshot successfully published to "oci://071440425669.ecr.us-east-1.amazonaws.com/karpenter/snapshot/karpenter:v0-cb5c8e46c1abc48b876ae86d2dafd28f2393d2fe".

pkg/cache/cache.go Outdated Show resolved Hide resolved
pkg/providers/instancetype/instancetype.go Show resolved Hide resolved
pkg/providers/instancetype/instancetype.go Show resolved Hide resolved
pkg/providers/instancetype/instancetype.go Outdated Show resolved Hide resolved
pkg/providers/instancetype/instancetype.go Show resolved Hide resolved
@engedaam engedaam force-pushed the fix-memory-incress branch 3 times, most recently from e32a06c to f9c7fc8 Compare December 14, 2023 02:08
Copy link
Contributor Author

@engedaam engedaam left a comment

Choose a reason for hiding this comment

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

/karpenter snapshot

Copy link
Contributor

Snapshot successfully published to "oci://071440425669.ecr.us-east-1.amazonaws.com/karpenter/snapshot/karpenter:v0-f9c7fc899d354582ac27c5b2b6f1997293e2fac0".

@engedaam engedaam force-pushed the fix-memory-incress branch 4 times, most recently from 5504e8f to f758263 Compare December 14, 2023 03:23
Copy link
Contributor Author

@engedaam engedaam left a comment

Choose a reason for hiding this comment

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

/karpenter snapshot

Copy link
Contributor

Snapshot successfully published to "oci://071440425669.ecr.us-east-1.amazonaws.com/karpenter/snapshot/karpenter:v0-f7582631b90095bd6ca53442e5a3d158182e8a42".

Copy link
Contributor Author

@engedaam engedaam left a comment

Choose a reason for hiding this comment

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

/karpenter scale

Copy link
Contributor

Snapshot successfully published to "oci://071440425669.ecr.us-east-1.amazonaws.com/karpenter/snapshot/karpenter:v0-f7582631b90095bd6ca53442e5a3d158182e8a42".

@engedaam engedaam force-pushed the fix-memory-incress branch 2 times, most recently from 2322881 to 46bb857 Compare December 15, 2023 00:16
Copy link
Contributor Author

@engedaam engedaam left a comment

Choose a reason for hiding this comment

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

/karpenter snapshot

Copy link
Contributor

Snapshot successfully published to "oci://021119463062.ecr.us-east-1.amazonaws.com/karpenter/snapshot/karpenter:v0-46bb857a831bcfa75694f396e1c7b1e430f62583".

Copy link
Contributor Author

@engedaam engedaam left a comment

Choose a reason for hiding this comment

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

/karpenter snapshot

Copy link
Contributor

Snapshot successfully published to "oci://021119463062.ecr.us-east-1.amazonaws.com/karpenter/snapshot/karpenter:v0-ce36bc4fae732e652970eccbcec160aa8d04b43d".

Copy link
Contributor

@jonathan-innis jonathan-innis 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. Just a couple of questions

pkg/providers/instancetype/instancetype.go Outdated Show resolved Hide resolved
pkg/cache/cache.go Outdated Show resolved Hide resolved
@engedaam engedaam force-pushed the fix-memory-incress branch 2 times, most recently from d2eaceb to 2a86404 Compare December 15, 2023 00:56
Copy link
Contributor Author

@engedaam engedaam left a comment

Choose a reason for hiding this comment

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

/karpenter snapshot

Copy link
Contributor

Snapshot successfully published to oci://021119463062.dkr.ecr.us-east-1.amazonaws.com/karpenter/snapshot/karpenter:v0-2a86404dfb10aa06881e6f46e656dd3565d2c454.
To install you must login to the ECR repo with an AWS account:

aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 021119463062.dkr.ecr.us-east-1.amazonaws.com

Copy link
Contributor Author

@engedaam engedaam left a comment

Choose a reason for hiding this comment

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

/karpenter snapshot

Copy link
Contributor

Snapshot successfully published to oci://021119463062.dkr.ecr.us-east-1.amazonaws.com/karpenter/snapshot/karpenter:v0-72a42ef401108e7ef9760ca36d694bdd217ba017.
To install you must login to the ECR repo with an AWS account:

aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 021119463062.dkr.ecr.us-east-1.amazonaws.com

Copy link
Contributor Author

@engedaam engedaam left a comment

Choose a reason for hiding this comment

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

/karpenter scale

Copy link
Contributor

@jonathan-innis jonathan-innis left a comment

Choose a reason for hiding this comment

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

This all seems good to me. If we are confident that this cleanup interval isn't going to tangibly hurt our performance and improve our memory footprint, then 🚀

@engedaam engedaam merged commit d71bcd8 into aws:main Dec 15, 2023
27 of 28 checks passed
@engedaam engedaam deleted the fix-memory-incress branch December 15, 2023 14:45
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.

Karpenter memory utilisation balloons after upgrade to 0.32.2
3 participants