FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Move over to controller-runtime over doing it ourselves by davidcollom · Pull Request #348 · jetstack/version-checker · GitHub

Move over to controller-runtime over doing it ourselves - #348

Merged
davidcollom merged 6 commits into
mainfrom
controller-runtime
Mar 31, 2025
Merged

Move over to controller-runtime over doing it ourselves#348
davidcollom merged 6 commits into
mainfrom
controller-runtime

Conversation

davidcollom commented Mar 27, 2025
edited
Loading

Copy link
Copy Markdown
Collaborator

During testing we identified that there was significant memory utilisation when running version-checker for 2-3 days we saw that our test cluster was running at ~400+MB when it started off at around 40-60MB.

This PR changes over from manually implemented shared informers and managing the workqueue and its goroutines, to use controller-runtime, this means we don't have to manage as much code/logic and workers ourselves and is managed for us, allowing us to focus more on the purpose of version-checker.

We do believe that there is still a memory leak, however from testing (over 24 hour period) on the same cluster, that memory usage has increased at a much slower rate, additionally we've seen that goroutines are staying at a reasonable number, where as previously it was growing exponentially at, what was an alarming rate under some situations.

Copy link
Copy Markdown
Collaborator Author

Some Screenshots of our findings.... Here's our last 2 days where version-checker was running for several days:

Here's a closer look at the memory utilisation:

And the GoRoutines:

After:

With a lot of this in mind, we've ensured that CPU usage/profile has not changed (%age is calculated towards 1 full CPU - I.E: 200m=0.2%) :

Comment thread pkg/client/acr/acr.go
)

type Client struct {
*http.Client

davidcollom Mar 27, 2025
edited
Loading

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

There's never a http.Client used within ACR - it creates its own - so removing.

Copy link
Copy Markdown
Collaborator Author

I discovered a secondary leak where some metrics weren't cleaned up on pod deletion.

Comment thread pkg/metrics/metrics.go
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
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.

3 participants


Back | FazBrowse Home | New Git URL