Ensure GOMAXPROCS & GOMEMLIMIT align with K8s limits#1755
Ensure GOMAXPROCS & GOMEMLIMIT align with K8s limits#1755lburgazzoli wants to merge 1 commit intoopendatahub-io:mainfrom
Conversation
Set GOMAXPROCS and GOMEMLIMIT based on the CPU/memory limits defined in the deployment manifests. This ensures optimal resource utilization and prevents performance degradation caused by CPU throttling or OOM issues in containerized Go apps. References: - https://www.ardanlabs.com/blog/2024/02/kubernetes-cpu-limits-go.html - https://www.ardanlabs.com/blog/2024/02/kubernetes-memory-limits-go.html
|
Skipping CI for Draft Pull Request. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1755 +/- ##
==========================================
- Coverage 23.97% 23.96% -0.02%
==========================================
Files 172 172
Lines 11699 11704 +5
==========================================
Hits 2805 2805
- Misses 8614 8619 +5
Partials 280 280 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@lburgazzoli: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
Description
Set GOMAXPROCS and GOMEMLIMIT based on the CPU/memory limits
defined in the deployment manifests. This ensures optimal
resource utilization and prevents performance degradation
caused by CPU throttling or OOM issues in containerized Go apps.
References:
Note
As of today, we do configure the operator Deployment with some
resources requests and limits, however, we do not configure the go
runtime according. At this stage this is just an hypothesis, but since
that on a large cluster, the GOMAXPROCS would be automatically
set to the number of cores, resulting in a sub-optimal setup as the
go runtime would assume it can use all the cores, However, we set
500m as resource limit for CPU so we won't be able to use more than
a single thread.
How Has This Been Tested?
Screenshot or short clip
Merge criteria