All Products
Search
Document Center

Alibaba Cloud Service Mesh:Configuration push optimization overview

Last Updated:Jun 05, 2023

Service Mesh (ASM) provides service discovery selectors, sidecar recommendation, and adaptive xDS optimization features to help you improve the configuration push efficiency of the control plane and reduce the configuration size of a sidecar. This topic describes these features and their applicable scenarios.

By default, a sidecar stores configurations of all services in a cluster on the data plane because the control plane cannot determine the relationships among the services and workloads. Each time you modify configurations on the control plane or data plane, the control plane pushes the new configurations to all sidecars on the data plane. For example, if you create a virtual service on the control plane, the control plane pushes information about the virtual service to all sidecars on the data plane.

If you have a large number of workloads deployed in a cluster on the data plane, a sizable portion of the resources in the cluster are occupied by sidecars. In addition, the control plane faces a heavy load of configuration push. This reduces the efficiency and availability of the control plane. To address the issue, ASM provides service discovery selectors, sidecar recommendation, and adaptive xDS optimization features.

Service discovery selectors

Feature introduction

You can configure label selectors based on the labels of the namespaces in the cluster. The label selectors ensure that the control plane discovers and processes only services in the selected namespaces. This way, sidecars store only the configurations of services in the selected namespaces, because the control plane does not push the configurations of services in unselected namespaces to sidecars. For more information, see Use service discovery selectors to improve the configuration push efficiency of the control plane.

Scenario

The feature uses label selectors to reduce the number of services that the control plane discover and process. The control plane pushes only configurations of services in the selected namespaces to sidecars. When your data plane contains a large number of namespaces and services, you can use this feature to select the namespaces for ASM to perform service discovery. This way, the control plane can push service configurations more efficiently.

Sidecar recommendation

Feature introduction

ASM can obtain the call dependencies between services on the data plane by analyzing the access logs generated by sidecars on the data plane. ASM can then automatically recommend a sidecar for each workload on the data plane. The sidecar recommendation feature has the following benefits:

  • Only the information about the services related to the workload that corresponds to a sidecar is stored in the sidecar.

  • If an unrelated service is modified, or a resource such as a virtual service of a related service is modified, the control plane does not push the new configuration to the sidecar. This significantly improves the configuration push efficiency of the control plane. For more information about the effects of sidecar recommendation, see Effects of sidecar recommendation on configuration push optimization.

For more information about the sidecar recommendation feature, see Use the sidecars that are automatically recommended based on access log analysis.

Scenario

If service discovery selectors cannot meet your requirements for configuration push optimization, you can use the sidecar recommendation feature to improve the efficiency of configuration push. After the sidecar recommendation feature is enabled, ASM recommends and creates sidecars for you based on access logs. You do not need to manually write YAML files to create sidecars. The sidecar recommendation feature is applicable if you have deployed a large number of services in a single namespace and you want to reduce the size of sidecar configurations to the maximum extent.

Adaptive xDS optimization

Feature introduction

The adaptive xDS optimization feature is similar to the sidecar recommendation feature. They both apply sidecars to workloads on the data plane to improve the configuration push efficiency. However, the adaptive xDS optimization feature has the following characteristics:

  • After you enable the adaptive xDS optimization feature, sidecars are automatically generated and updated for the workloads that you select. You do not need to manually configure or update the sidecars. When the call dependencies between services change, you do not need to recommend new sidecars.

  • When you use the adaptive xDS optimization feature, you do not need to enable Log Service to collect access logs on the data plane.

  • After you enable the adaptive xDS optimization feature, an egress gateway named istio-axds-egressgateway is deployed on the data plane. The feature only applies to the workloads that you select. All HTTP traffic generated by the selected workloads is routed to the egress gateway before the call dependencies are analyzed. We recommend that you gradually add workloads to which the feature applies. This prevents impacts on the traffic in the cluster.

For more information, see Use adaptive xDS optimization to improve the configuration push efficiency of the control plane.

Scenario

The adaptive xDS optimization feature automatically generates and updates sidecars for your workloads. This is the easiest way to improve the configuration push efficiency. You can use this feature to improve the configuration push efficiency at minimal costs if you are not familiar with sidecars or configuration push optimization.

The feature depends on the egress gateway deployed on the data plane. The control plane analyzes the call dependencies among services based on the access logs of the egress gateway. The feature may have impacts on the traffic on the data plane and consume resources on the control plane. Therefore, we recommend that you gradually add workloads to which this feature applies.