SetHttp2Windows plug-in

Updated at:

The SetHttp2Windows plug-in reduces sidecar proxy memory consumption by lowering HTTP/2 flow-control window sizes. Use it when HTTP/2 or gRPC workloads cause excessive memory growth in sidecar proxies.

How it works

The HTTP/2 codec in each sidecar proxy maintains two buffer limits that act as soft caps on how many bytes the proxy buffers:

ParameterScopeDefault
initial_stream_window_sizePer stream256 MB
initial_connection_window_sizePer connection (all streams combined)256 MB

When a slow upstream service cannot consume data as fast as the proxy receives it, data accumulates in the proxy's codec buffers up to these limits. At 256 MB per stream and per connection, a single connection can consume hundreds of megabytes of memory.

Reducing both values to a smaller threshold, such as 65536 (64 KB), directly limits per-stream and per-connection memory growth.

Important

Restart all pods within the effective scope after you enable this plug-in. The new window sizes apply only after a pod restart.

Configuration fields

Name

Type

Required

Default

Description

patch_context

string

No

ANY

Scope where the plug-in takes effect. GATEWAY: gateway only. ANY: both gateway and sidecar proxy.

port_number

string

Yes

-

Port where the plug-in takes effect. For gateways, set this to the gateway listening port. For workloads, set this to the container port.

initial_connection_window_size

string

Yes

-

Initial connection-level flow-control window size in bytes. Recommended: 65536.

initial_stream_window_size

string

Yes

-

Initial stream-level flow-control window size in bytes. Recommended: 65536.

When to use this plug-in

Enable SetHttp2Windows when sidecar proxies show high memory usage under HTTP/2 or gRPC traffic. Common symptoms:

  • Sidecar proxy memory grows steadily under sustained gRPC streaming or HTTP/2 traffic.

  • Upstream services process requests slower than the rate at which the proxy receives data.

  • Pod evictions or OOMKilled errors traced to sidecar containers.

Recommended values

Set both initial_connection_window_size and initial_stream_window_size to 65536 (64 KB). This value is sufficient for most workloads.

Note

Lowering window sizes reduces how much data the proxy buffers at a time. For high-throughput streaming workloads, test with your actual traffic patterns to find the right balance between memory savings and throughput.