All Products
Search
Document Center

Alibaba Cloud Service Mesh:Why does the memory usage of sidecars keep increasing?

Last Updated:Mar 11, 2026

Sidecar memory usage can grow continuously due to configuration bloat, request buffering, metric cardinality, or HTTP/2 flow-control defaults. This topic explains each cause and how to resolve it.

Symptom

Pod-level memory monitoring shows that sidecar (Envoy) memory usage keeps increasing over time.

Causes

Cause

Description

Configurations stored in sidecars

By default, each sidecar stores the configurations of all services in the cluster, including endpoint information. As more services are deployed, configuration volume and memory usage increase.

Real-time request traffic

Envoy buffers incoming requests, outgoing responses, and queued requests. Under heavy traffic, these buffers consume significant memory.

High-cardinality metrics

Metrics with a large number of unique label combinations occupy substantial memory.

gRPC throttling-related data

The HTTP/2 codec uses initial_stream_window_size and initial_connection_window_size, both defaulting to 256 MB. When services process data slower than it arrives, unprocessed data accumulates in sidecar memory.

Solutions

Reduce configuration scope

By default, sidecars receive configurations for every service in the cluster. Narrowing the scope to only the services a workload communicates with reduces memory usage.

  1. Log on to the ASM console.

  2. In the left-side navigation pane, choose Service Mesh > Mesh Management.

  3. Find the target ASM instance and click Manage in the Actions column.

  4. In the left-side navigation pane, choose Mesh Optimization Center > Sidecar recommendation.

  5. Configure sidecar recommendation to limit which service configurations are pushed to each sidecar.

For more information, see Configuration push optimization overview.

Bypass unnecessary traffic interception

Excluding traffic that does not need mesh-level observability or policy enforcement reduces the amount of data Envoy buffers. For example, exclude connections to middleware such as Redis (port 2379) or MySQL (port 3306), or traffic originating from outside the cluster.

  1. Log on to the ASM console. In the left-side navigation pane, choose Service Mesh > Mesh Management.

  2. On the Mesh Management page, click the name of the ASM instance. In the left-side navigation pane, choose Dataplane Component Management > Sidecar Proxy Setting.

  3. On the Sidecar Proxy Setting page, click the global tab. Then, click enable/disable Sidecar proxy by port or address and configure the block scope.

    Global settings

Reduce metric cardinality

Metrics with a large number of unique label values are a common source of memory pressure. Review custom metrics and remove or aggregate labels that produce excessive cardinality.

For more information, see Create custom metrics in ASM.

Tune HTTP/2 flow-control window sizes

The HTTP/2 codec in Envoy uses two flow-control parameters:

ParameterDefaultDescription
initial_stream_window_size256 MBMaximum bytes buffered per stream
initial_connection_window_size256 MBMaximum bytes buffered across all streams on a single connection

When gRPC or HTTP/2 upstream and downstream services consume data slower than it arrives, Envoy accumulates data up to these limits. Lowering these values reduces the maximum memory that flow control can consume per sidecar.

  1. Log on to the ASM console. In the left-side navigation pane, choose Service Mesh > Mesh Management.

  2. On the Mesh Management page, click the name of the ASM instance. In the left-side navigation pane, choose Plugin Extension Center > Market Place.

  3. On the Market Place page, click Set the initial window size for http2/grpc and configure initial_stream_window_size and initial_connection_window_size to values appropriate for your workload.

References