Repository navigation
Description
Description:
Envoy Gateway configures Envoy's overload manager from the envoy container's memory limit. calculateMaxHeapSizeBytes (internal/infrastructure/kubernetes/proxy/resource.go) takes 80% of the limit and returns 0 when there is none. bootstrap.yaml.tpl then leaves out the fixed_heap resource monitor and the shrink_heap and stop_accepting_requests actions that depend on it.
The default envoy container only has requests (DefaultResourceRequirements(): 100m CPU, 512Mi memory). So a proxy created without an EnvoyProxy that sets a memory limit runs with no heap-based overload protection. Under memory pressure it neither shrinks its heap nor stops accepting requests; it grows until node pressure leads to eviction or the node's OOM killer acts.
Checked on v1.9.2 (Helm chart defaults, kind), one Gateway per GatewayClass:
| envoy container resources | overload resource monitors | overload actions |
|---|---|---|
| default: requests only | global_downstream_max_connections |
none |
EnvoyProxy with limits.memory: 1Gi |
global_downstream_max_connections, fixed_heap (max_heap_size_bytes: 858993459) |
shrink_heap at 0.95, stop_accepting_requests at 0.98 |
Proposal: give the envoy container a default memory limit, so the heap actions Envoy Gateway already defines are active out of the box. The limit would sit above the request rather than equal to it, for example 1Gi with the 512Mi request, giving max_heap_size_bytes of about 800Mi. A memory limit set in an EnvoyProxy would keep replacing it.
Default memory limits were added before in #4960 and reverted in #4979. As far as I can tell, the revert was because shutdown-manager was OOM-killed in CI, not because of the envoy limit. In #5032, the open question about the envoy container was whether limit = request = 512Mi was the right default; a limit above the request avoids that. #10221 covers the shutdown-manager separately (32Mi). In the same v1.9.2 run, an idle shutdown-manager used 20–22 MiB of working set.
Would a default memory limit for the envoy container work for you, and at what value?
[optional Relevant Links:]
- Bootstrap overload manager:
internal/xds/bootstrap/bootstrap.yaml.tpl; heap size:internal/infrastructure/kubernetes/proxy/resource.go(calculateMaxHeapSizeBytes) - Earlier default limits: feat(default-memory-limits): set default memory limits #4960, reverted in Revert "feat(default-memory-limits): set default memory limits " #4979; discussion in feat(default-memory-limits): set default memory limits #5032
- shutdown-manager limit: Add default memory limit for shutdown-manager container #8912, feat: add default memory limit for shutdown-manager #10221
- Overload manager configurability and docs: Tweaking overload settings in gateway api? #3604, Document overload manager configuration #8749, docs: document overload manager defaults #10161
Activity
github-actions commentedon Nov 12, 2026
This issue has been automatically marked as stale because it has not had activity in the last 30 days.