Ensure GOMAXPROCS & GOMEMLIMIT align with K8s limits #1755
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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