Skip to content

Envoy's heap overload actions are off for the default proxy, because it has no memory limit #10263

Open

Description

@martin-mat

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:]

Activity

  1. github-actions commented on Nov 12, 2026

    @github-actions
    Contributor

    This issue has been automatically marked as stale because it has not had activity in the last 30 days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions