All Products
Search
Document Center

Alibaba Cloud Service Mesh:Adaptive xds optimization

Last Updated:Jun 12, 2025

Use adaptive xds optimization feature to enhance the performance of the service mesh.

Important
  • To enable adaptive xds optimization, upgrade an ASM instance to 1.15.3.63 or later.

  • The adaptive xds optimization supports only HTTP.

Background

The Sidecar stores service information in the data plane, while the control plane pushes configuration updates (e.g., new virtual service rules) to all Sidecars. Frequent updates can degrade service mesh performance.

To optimize this process, enable the adaptive xds optimization feature. This deploys an egress gateway (istio-axds-egressgateway) in the cluster. All HTTP traffic is routed through this gateway, and service dependencies are automatically inferred from gateway access logs—no manual configuration required. See Configuration push optimization effect after applying Sidecar resources for more details.

Before you start

Step 1: Enable adaptive xds optimization

  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 Mesh Optimization Center > Adaptive xds optimization.

  3. Turn on the Enable adaptive xds optimization switch. In the Confirm dialog box, click OK.

    After you click OK, the update takes a while. When the Enable adaptive xds optimization switch is turned on, a list of namespaces that can be adaptively optimized will be displayed.

Step 2: Enable adaptive xds optimization for a namespace

The adaptive xds optimization applies to all services in the namespace. You can also add the annotations asm.alibabacloud.com/asm-adaptive-xds: true in a service to enable adaptive xds optimization for it only.

  1. On the Mesh Management page, click the name of the ASM instance. In the left-side navigation pane, choose Mesh Optimization Center > Adaptive xds optimization.

  2. Turn on the switch to the right of the target service namespace. In the Confirm dialog box, click OK.

  3. On the details page of the ASM instance, choose Traffic Management Center > Sidecar Traffic Configuration in the left-side navigation pane.

  4. On the Sidecar Traffic Configuration page, view the Sidecar resource details.

    Sidecar resources starting with axds are listed. Each Sidecar resource corresponds to a service in the Bookinfo application.Sidecar资源

Step 3: Access the application to trigger adaptive xds optimization

  1. Obtain the IP address of the ingress gateway.

  2. Access the Bookinfo application through:

# Replace {IP address of the ingress gateway} with the IP address obtained in the previous step.
http://{IP address of the ingress gateway}/productpage. 
  1. View the Sidecar resources.

    1. On the Mesh Management page, click the name of the ASM instance. In the left-side navigation pane, choose Traffic Management Center > Sidecar Traffic Configuration.

    2. On the Sidecar Traffic Configuration page, click View YAML in the Actions column to the right of axds-productpage. The following example is displayed:

      apiVersion: networking.istio.io/v1beta1
      kind: Sidecar
      metadata:
        annotations:
          adapted-svc: productpage.default.svc.cluster.local
        creationTimestamp: '2024-01-05T07:52:56Z'
        generation: 4
        labels:
          asm-adaptive-xds-system: 'true'
          asm-system: 'true'
          provider: asm
        name: axds-productpage
        namespace: default
        resourceVersion: '23688435'
        uid: 753e3603-6bee-4dd1-b1fc-2e735a88****
      spec:
        egress:
          - hosts:
              - arms-prom/*
              - default/details.default.svc.cluster.local
              - default/kubernetes.default.svc.cluster.local
              - default/reviews.default.svc.cluster.local
              - istio-system/*
              - kube-system/*
        workloadSelector:
          labels:
            app: productpage

      After accessing Bookinfo, the Sidecar resource axds-productpage has added details and reviews which productpage relies on.

Performance comparison

The following tests compares the performance of the control plane and data plane where the namespace asm-perf has not enabled and has enabled adaptive configuration push optimization when large amount of configurations update.

  • Scale out workloads: Scale httpbin from 2 to 400 replicas.

  • Initiate test traffic: Randomly send requests from the sleep application to different httpbin applications, triggering adaptive xds optimization re-push.

  • Restart workloads: Trigger redeployment of the httpbin application, simulating workload scaling and update scenarios.

Step 1: Prepare environment

  1. Obtain the sample script.

    git clone https://github.com/AliyunContainerService/asm-labs.git && \
    
    cd asm-labs/asm-perf/adativexds
  2. Build the test environment.

    bash run.sh -s

    This command will create the following resources in the cluster:

    • Namespace asm-perf.

    • prometheus and grafana for monitoring workloads.

    • A sleep application and 2 replicas of the httpbin application to receive configuration pushes.

    Use the following command for port forwarding to the dashboard. You can access the dashboard by visiting localhost:3000.

    kubectl port-forward svc/grafana -n asm-perf 3000

Step 2: Compare performance

  1. Scale out workloads.

    bash run.sh -su

    After a while, check the dashboard. Expected results are as follows:

    Adaptive xds optimization disabled

    CPU utilization of the sleep application

    image.png

    Memory usage of the sleep application

    image.png

    Network bandwidth usage of the sleep application

    image.png

    Control plane traffic changes
    1. On the Base Information page of the mesh instance, record the CLB ID after CLB Instance for Exposing Istio Pilot.

    2. Log on to the Classic Load Balancer CLB console. Click the Monitoring column icon for the corresponding CLB, and select Listener > Bandwidth/Traffic to view the chart.

      image.png

    When services in the mesh have changed, the control plane pushes configuration updates, which degrades the performance.

    Adaptive xds optimization enabled

    CPU utilization of the sleep application

    image.png

    Memory usage of the sleep application

    image.png

    Network bandwidth usage of the sleep application

    image.png

    Control plane traffic changes

    image.png

    The degrading is not worse than that when adaptive xds optimization disabled.

    View Sidecar resource configuration
    1. View the Sidecar resource configuration in effect for the sleep application.

      kubectl get sidecar axds-sleep -n asm-perf -o yaml

      Expected output:

      apiVersion: networking.istio.io/v1
      kind: Sidecar
      metadata:
        annotations:
          adapted-svc: sleep.asm-perf.svc.cluster.local
        creationTimestamp: "2025-04-03T03:09:42Z"
        generation: 2
        labels:
          asm-adaptive-xds-system: "true"
          asm-system: "true"
          provider: asm
        name: axds-sleep
        namespace: asm-perf
        resourceVersion: "14844729886"
        uid: 31dfc081-b0ec-403f-b420-91f3c3e5f8fb
      spec:
        egress:
        - hosts:
          - arms-prom/*
          - asm-perf/grafana.asm-perf.svc.cluster.local
          - default/kubernetes.default.svc.cluster.local
          - istio-system/*
          - kube-system/*
        workloadSelector:
          labels:
            app: sleep

      Multiple services reside under spec.egress.hosts. This means that only changes to the above services will trigger configuration update for the sleep application. See Configuration push optimization effect after applying Sidecar resources for more.

  2. Initiate test traffic. Send a total of 100 requests randomly from the sleep application to different httpbin applications.

    bash run.sh -t

    After the requests are completed, check the dashboard.

    Adaptive xds optimization disabled

    CPU utilization of the sleep application

    image.png

    Memory usage of the sleep application

    image

    Network bandwidth usage of the sleep application

    image

    Control plane traffic changes

    image

    Initiating traffic from the sleep application does not affect configuration updates, because each workload has a complete configuration.

    Adaptive xds optimization enabled

    CPU utilization of the sleep application

    image

    Memory usage of the sleep application

    image

    Network bandwidth usage of the sleep application

    image

    Control plane traffic changes

    image.png

    Initiating traffic from the sleep application triggers configuration updates from the control plane.

    View Sidecar resource configuration
    1. View the Sidecar resource configuration in effect for the sleep application.

      kubectl get sidecar axds-sleep -n asm-perf -o yaml

      Expected output:

      Expand to view expected output

      apiVersion: networking.istio.io/v1
      kind: Sidecar
      metadata:
        annotations:
          adapted-svc: sleep.asm-perf.svc.cluster.local
        creationTimestamp: "2025-04-03T05:26:00Z"
        generation: 90
        labels:
          asm-adaptive-xds-system: "true"
          asm-system: "true"
          provider: asm
        name: axds-sleep
        namespace: asm-perf
        resourceVersion: "14845598119"
        uid: a272cb0f-6e6a-492e-9ee1-b0d072813c19
      spec:
        egress:
        - hosts:
          - arms-prom/*
          - asm-perf/grafana.asm-perf.svc.cluster.local
          - asm-perf/httpbin-v102.asm-perf.svc.cluster.local
          - asm-perf/httpbin-v113.asm-perf.svc.cluster.local
          - asm-perf/httpbin-v115.asm-perf.svc.cluster.local
          - asm-perf/httpbin-v116.asm-perf.svc.cluster.local
          - asm-perf/httpbin-v121.asm-perf.svc.cluster.local
          - asm-perf/httpbin-v122.asm-perf.svc.cluster.local
          - asm-perf/httpbin-v13.asm-perf.svc.cluster.local
          - asm-perf/httpbin-v131.asm-perf.svc.cluster.local
          - asm-perf/httpbin-v136.asm-perf.svc.cluster.local
          - asm-perf/httpbin-v144.asm-perf.svc.cluster.local
          - asm-perf/httpbin-v145.asm-perf.svc.cluster.local
          - asm-perf/httpbin-v151.asm-perf.svc.cluster.local
          - asm-perf/httpbin-v158.asm-perf.svc.cluster.local
          - asm-perf/httpbin-v17.asm-perf.svc.cluster.local
          - asm-perf/httpbin-v170.asm-perf.svc.cluster.local
          - asm-perf/httpbin-v174.asm-perf.svc.cluster.local
          - asm-perf/httpbin-v19.asm-perf.svc.cluster.local
          - asm-perf/httpbin-v203.asm-perf.svc.cluster.local
          - asm-perf/httpbin-v218.asm-perf.svc.cluster.local
          - asm-perf/httpbin-v220.asm-perf.svc.cluster.local
          - asm-perf/httpbin-v222.asm-perf.svc.cluster.local
          - asm-perf/httpbin-v223.asm-perf.svc.cluster.local
          - asm-perf/httpbin-v227.asm-perf.svc.cluster.local
          - asm-perf/httpbin-v230.asm-perf.svc.cluster.local
          - asm-perf/httpbin-v235.asm-perf.svc.cluster.local
          - asm-perf/httpbin-v24.asm-perf.svc.cluster.local
          - asm-perf/httpbin-v240.asm-perf.svc.cluster.local
          - asm-perf/httpbin-v243.asm-perf.svc.cluster.local
          - asm-perf/httpbin-v245.asm-perf.svc.cluster.local
          - asm-perf/httpbin-v247.asm-perf.svc.cluster.local
          - asm-perf/httpbin-v252.asm-perf.svc.cluster.local
          - asm-perf/httpbin-v254.asm-perf.svc.cluster.local
          - asm-perf/httpbin-v257.asm-perf.svc.cluster.local
          - asm-perf/httpbin-v258.asm-perf.svc.cluster.local
          - asm-perf/httpbin-v259.asm-perf.svc.cluster.local
          - asm-perf/httpbin-v26.asm-perf.svc.cluster.local
          - asm-perf/httpbin-v260.asm-perf.svc.cluster.local
          - asm-perf/httpbin-v265.asm-perf.svc.cluster.local
          - asm-perf/httpbin-v266.asm-perf.svc.cluster.local
          - asm-perf/httpbin-v269.asm-perf.svc.cluster.local
          - asm-perf/httpbin-v270.asm-perf.svc.cluster.local
          - asm-perf/httpbin-v271.asm-perf.svc.cluster.local
          - asm-perf/httpbin-v276.asm-perf.svc.cluster.local
          - asm-perf/httpbin-v281.asm-perf.svc.cluster.local
          - asm-perf/httpbin-v283.asm-perf.svc.cluster.local
          - asm-perf/httpbin-v30.asm-perf.svc.cluster.local
          - asm-perf/httpbin-v32.asm-perf.svc.cluster.local
          - asm-perf/httpbin-v321.asm-perf.svc.cluster.local
          - asm-perf/httpbin-v325.asm-perf.svc.cluster.local
          - asm-perf/httpbin-v33.asm-perf.svc.cluster.local
          - asm-perf/httpbin-v330.asm-perf.svc.cluster.local
          - asm-perf/httpbin-v331.asm-perf.svc.cluster.local
          - asm-perf/httpbin-v335.asm-perf.svc.cluster.local
          - asm-perf/httpbin-v338.asm-perf.svc.cluster.local
          - asm-perf/httpbin-v34.asm-perf.svc.cluster.local
          - asm-perf/httpbin-v340.asm-perf.svc.cluster.local
          - asm-perf/httpbin-v341.asm-perf.svc.cluster.local
          - asm-perf/httpbin-v345.asm-perf.svc.cluster.local
          - asm-perf/httpbin-v346.asm-perf.svc.cluster.local
          - asm-perf/httpbin-v348.asm-perf.svc.cluster.local
          - asm-perf/httpbin-v353.asm-perf.svc.cluster.local
          - asm-perf/httpbin-v354.asm-perf.svc.cluster.local
          - asm-perf/httpbin-v357.asm-perf.svc.cluster.local
          - asm-perf/httpbin-v36.asm-perf.svc.cluster.local
          - asm-perf/httpbin-v365.asm-perf.svc.cluster.local
          - asm-perf/httpbin-v368.asm-perf.svc.cluster.local
          - asm-perf/httpbin-v370.asm-perf.svc.cluster.local
          - asm-perf/httpbin-v373.asm-perf.svc.cluster.local
          - asm-perf/httpbin-v378.asm-perf.svc.cluster.local
          - asm-perf/httpbin-v379.asm-perf.svc.cluster.local
          - asm-perf/httpbin-v387.asm-perf.svc.cluster.local
          - asm-perf/httpbin-v390.asm-perf.svc.cluster.local
          - asm-perf/httpbin-v397.asm-perf.svc.cluster.local
          - asm-perf/httpbin-v41.asm-perf.svc.cluster.local
          - asm-perf/httpbin-v46.asm-perf.svc.cluster.local
          - asm-perf/httpbin-v47.asm-perf.svc.cluster.local
          - asm-perf/httpbin-v48.asm-perf.svc.cluster.local
          - asm-perf/httpbin-v52.asm-perf.svc.cluster.local
          - asm-perf/httpbin-v58.asm-perf.svc.cluster.local
          - asm-perf/httpbin-v62.asm-perf.svc.cluster.local
          - asm-perf/httpbin-v66.asm-perf.svc.cluster.local
          - asm-perf/httpbin-v68.asm-perf.svc.cluster.local
          - asm-perf/httpbin-v7.asm-perf.svc.cluster.local
          - asm-perf/httpbin-v86.asm-perf.svc.cluster.local
          - asm-perf/httpbin-v89.asm-perf.svc.cluster.local
          - asm-perf/httpbin-v91.asm-perf.svc.cluster.local
          - asm-perf/httpbin-v92.asm-perf.svc.cluster.local
          - asm-perf/httpbin-v94.asm-perf.svc.cluster.local
          - default/kubernetes.default.svc.cluster.local
          - istio-system/*
          - kube-system/*
        workloadSelector:
          labels:
            app: sleep

      Multiple services reside under spec.egress.hosts. This means that only changes to the above services will trigger configuration re-push for the sleep application. See Configuration push optimization effect after applying Sidecar resources for more.

  3. Restart workloads.

    bash run.sh -r

    After all workloads have restarted, check the control plane traffic changes.

    Adaptive xds optimization disabled

    Control plane traffic changes

    image

    When services in the mesh have changed, the control plane pushes configuration updates, which degrades the performance.

    Adaptive xds optimization enabled

    Control plane traffic changes

    image

    The volume of configuration updates is significantly reduced compared to when adaptive xds optimization is disabled.

  4. Restore the test environment.

    bash run.sh -sd

    It takes about 2 minutes for the httpbin application pods to scale in from 400 to 2.

Further actions

Disable the adaptive xds optimization feature

  1. On the Mesh Management page, click the name of the ASM instance. In the left-side navigation pane, choose Mesh Optimization Center > Adaptive xds optimization.

  2. Turn off the switch to the right of the target service namespace. In the Confirm dialog box, click OK.

  3. In the left-side navigation pane of the service mesh details page, navigate to Traffic Management Center > Sidecar Traffic Configuration.

    The Sidecar resources created by the adaptive xds optimization feature have been deleted.

Modify egress gateway configuration

  1. On the Mesh Management page, click the name of the ASM instance. In the left-side navigation pane, choose Mesh Optimization Center > Adaptive xds optimization.

  2. Click the Egress Gateway Configuration tab, modify the configuration as needed, and then click Update Settings.

    Note

    ASM supports modifications on egress gateway configurations, including modifying resource settings, gateway replicas, HPA scaling, and gateway HPA metric monitoring.