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 in Elastic Compute Service (ECS) clusters.

Scenario

If applications are deployed in multiple zones, applications may call each other across zones. The following figure shows sample call links. In this figure, Application A in Zone 1 calls Application B in Zone 2. The cross-zone call increases network latency. As a result, the HTTP response time is increased. Scenario 1
If 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. Scenario 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 Intra-zone Provider First parameter on the application details page of the service provider.

  1. Log on to the EDAS console.
  2. In the left-side navigation pane, click Applications. In the top navigation bar, select a region. On the Applications page, select a microservice namespace in the upper part and click the name of a specific application that is deployed in an ECS cluster.
  3. In the Application Settings section of the Basic Information tab, enable the Intra-zone Provider First feature and specify a threshold.
    Enable Intra-zone Provider First
    Note The threshold indicates the ratio of the number of instances on which 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.