-
Notifications
You must be signed in to change notification settings - Fork 363
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
feat(default-memory-limits): set default memory limits #4960
feat(default-memory-limits): set default memory limits #4960
Conversation
ceaaa52
to
4ac01d9
Compare
@@ -215,6 +215,21 @@ spec: | |||
typed_config: | |||
"@type": type.googleapis.com/envoy.extensions.resource_monitors.downstream_connections.v3.DownstreamConnectionsConfig | |||
max_active_downstream_connections: 50000 | |||
- name: "envoy.resource_monitors.fixed_heap" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why these changes happen?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's set based on the memory limit by default, since memory limits weren't defined before they weren't being applied
Code here
gateway/internal/infrastructure/kubernetes/proxy/resource.go
Lines 356 to 369 in 2a10d47
// calculateMaxHeapSizeBytes calculates the maximum heap size in bytes as 80% of Envoy container memory limits. | |
// In case no limits are defined '0' is returned, which means no heap size limit is set. | |
func calculateMaxHeapSizeBytes(envoyResourceRequirements *corev1.ResourceRequirements) uint64 { | |
if envoyResourceRequirements == nil || envoyResourceRequirements.Limits == nil { | |
return 0 | |
} | |
if memLimit, ok := envoyResourceRequirements.Limits[corev1.ResourceMemory]; ok { | |
memLimitBytes := memLimit.Value() | |
return uint64(float64(memLimitBytes) * 0.8) | |
} | |
return 0 | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for clarify
…ners Signed-off-by: Ryan Hristovski <[email protected]>
4ac01d9
to
7c5bdda
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
looks like 32 cause OOM on master.
|
@zirain hmm, it's generally not best practice to have memory request & limits not equal to each other - but given that this is a shutdown manager it could make sense to have separate values. What do you think:
I didnt have time to fully benchmark it's resource use but it seems to sit idle around 25Mi and during shutdown (in my environment) it can hit around 70Mi. I'm leaning #1 due to the nature of the shutdown manager - but this could cause resource issues for users in the future. |
can you take a look at #4978? |
@ryanhristovski this block CI, I didn't figure out why(test passed on my local). let's revert it first, please resubmit later if you still want this, sorry for this. |
This reverts commit fddcf9b. Signed-off-by: zirain <[email protected]>
Revert "feat(default-memory-limits): set default memory limits (#4960)" This reverts commit fddcf9b. Signed-off-by: zirain <[email protected]>
Fixes #4882