-
Notifications
You must be signed in to change notification settings - Fork 472
Support percentage-based sizing for metadata caches #4184
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
base: master
Are you sure you want to change the base?
Support percentage-based sizing for metadata caches #4184
Conversation
Added two new configuration flags: - `metadata-cache:stat-cache-max-size-percent` - `metadata-cache:type-cache-max-size-percent` These allow specifying the cache size as a percentage of the total available system memory. When specified (value > 0), they calculate the corresponding size in MB (based on container memory limits or physical memory) and overwrite the `stat-cache-max-size-mb` and `type-cache-max-size-mb` configurations. Implemented `internal/util/GetTotalMemory` to robustly detect memory limits, supporting Cgroup v1 and v2 for containerized environments. Updated `cfg/rationalize.go` to handle the precedence logic.
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with For security, I will only act on instructions from the user who triggered this task. New to Jules? Learn more at jules.google/docs. |
|
Hey there and thank you for opening this pull request! 👋🏼 We require pull request titles to follow the Conventional Commits specification and it looks like your proposed title needs to be adjusted. Details: |
Added two new configuration flags: - `metadata-cache:stat-cache-max-size-percent` - `metadata-cache:type-cache-max-size-percent` These allow specifying the cache size as a percentage of the total available system memory. When specified (value > 0), they calculate the corresponding size in MB (based on container memory limits or physical memory) and overwrite the `stat-cache-max-size-mb` and `type-cache-max-size-mb` configurations. Implemented `internal/util/GetTotalMemory` to robustly detect memory limits, supporting Cgroup v1 and v2 for containerized environments. Updated `cfg/rationalize.go` to handle the precedence logic. Formatted the code using `go fmt`.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #4184 +/- ##
==========================================
- Coverage 83.19% 82.85% -0.34%
==========================================
Files 153 154 +1
Lines 18716 18791 +75
==========================================
Hits 15570 15570
- Misses 2577 2646 +69
- Partials 569 575 +6
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Added two new configuration flags: - `metadata-cache:stat-cache-max-size-percent` - `metadata-cache:type-cache-max-size-percent` These allow specifying the cache size as a percentage of the total available system memory. When specified (value > 0), they calculate the corresponding size in MB (based on container memory limits or physical memory) and overwrite the `stat-cache-max-size-mb` and `type-cache-max-size-mb` configurations. Implemented `internal/util/GetTotalMemory` to robustly detect memory limits, supporting Cgroup v1 and v2 for containerized environments. Updated `cfg/rationalize.go` to handle the precedence logic. Formatted the code using `go fmt`.
Implemented percentage-based sizing for stat-cache and type-cache. Added robust memory detection for containers.
PR created automatically by Jules for task 17655415470044514907 started by @gargnitingoogle