When an application calls a service, the service provider that resides in the same zone as the application is called first. This is how the Intra-zone Provider First feature works. In Enterprise Distributed Application Service (EDAS), you can enable the Intra-zone Provider First feature for Spring Cloud, Dubbo, and High-speed Service Framework (HSF) applications. This topic describes how to enable the feature for applications that are deployed on Kubernetes clusters.

Background information

When applications are deployed in multiple zones, applications may call each other across zones. The following figure shows sample call links.Scenario 1

In this figure, Application A in Zone 1 calls Application B in Zone 2, which means that the application on Node A1 calls the application on Node B2. The cross-zone call increases network latency. As a result, the HTTP response time is increased.

When the Intra-zone Provider First feature is enabled for a service application, the consumer application preferentially calls the provider that is deployed in the same zone. The following figure shows sample call links. The intra-zone call prevents network latency that is caused by the cross-zone call. This also reduces the HTTP response time. 场景2

If no provider is available in the same zone as the consumer application, the consumer application calls a provider in another zone.

Enable the Intra-zone Provider First feature

To enable the Intra-zone Provider First feature, you can set the Same zone priority parameter for the service provider.

  1. Log on to the EDAS console.
  2. Perform one of the following operations as needed to go to the application details page:
    • In the left-side navigation pane, choose Resource Management > Container Service Kubernetes Clusters or Resource Management > Serverless Kubernetes Clusters. In the top navigation bar, select a region. In the upper part of the page, select a namespace. On the Container Service Kubernetes Cluster or Serverless Kubernetes Clusters page, click a cluster ID. In the Applications section of the Cluster Details page, click the name of the application for which you want to view the details.
    • In the left-side navigation pane, click Applications. In the top navigation bar, select a region. In the upper part of the page, select a namespace. Select Container Service or Serverless Kubernetes Cluster from the Cluster Type drop-down list and click the application name.
  3. In the Service Governance section of the Application Overview page, click On to the right of Same zone priority.
  4. In the Service Governance section of the Application Overview page, click the Edit icon to the right of Same zone priority and specify a threshold.
    Note The threshold indicates the ratio of the number of instances where applications are deployed in the current zone to the total number of instances. The Intra-zone Provider First feature takes effect only when the threshold is exceeded. Valid values of the threshold: 0 to 100.