In a microservice framework, service calls are affected if consumers cannot detect the exceptions on the application instances of a provider. This further affects the performance and even availability of the services provided by the consumers. The outlier instance removal feature monitors the availability of application instances and dynamically adjusts the instances. This ensures successful service calls and improves the service stability and quality of service (QoS).

Background information

A system includes Applications A, B, C, and D, where Application A calls Applications B, C, and D. If the instances of Application B, C, or D become abnormal and Application A does not identify the abnormal instances, a part of calls initiated by Application A fail. Application B has one abnormal instance, and Applications C and D each have two abnormal instances. If Applications B, C, and D have a large number of abnormal instances, the service performance and availability of Application A may be affected.

To ensure the service performance and availability of Application A, you can configure an outlier application removal policy. After the policy is configured, Enterprise Distributed Application Service (EDAS) can monitor the instance status of Applications B, C, and D, and dynamically add or remove instances to ensure successful service calls.

The following list describes the process of outlier instance removal:

  1. EDAS detects whether Applications B, C, and D have abnormal instances. Then, EDAS determines whether to remove the abnormal instances from the applications based on the configured Upper limit of instance removal ratio parameter.
  2. EDAS does not distribute the call requests of Application A to the removed instances.
  3. EDAS detects whether the abnormal instances are recovered based on the configured Recovery detection unit time parameter.
  4. The detection interval is proportional to the number of detection times and linearly increases by the value of the Recovery detection unit time parameter, which is 0.5 minutes by default. If the value of the Maximum cumulative number of times not restored parameter is reached, EDAS detects whether the abnormal instances are recovered at the maximum detection interval.
  5. After the abnormal instances are recovered, they are added to the instance lists of the applications to continue processing call requests. The detection interval is reset to the value of the Recovery detection unit time parameter, such as 0.5 minutes.
Note
  • If the provider has a large number of abnormal instances and the ratio of the abnormal instances exceeds the value of the Upper limit of instance removal ratio parameter, the number of actually removed instances equals the configured upper limit.
  • If the provider has only one instance available, this instance is not removed even if the error rate exceeds the configured limit.

Create an outlier instance removal policy

  1. Log on to the EDAS console.
  2. In the left-side navigation pane, choose Microservices Governance > Service Mesh.
  3. In the navigation tree of the Service Mesh page, click Outlier Instance Removal.
  4. In the top navigation bar, select a region. On the Outlier Instance Removal page, select a microservice namespace and click Create an outlier removal policy.
  5. In the Basic information step of the Create Outlier Instance Removal Policy wizard, set the parameters and click Next Step.

    The following table describes the parameters in the Basic information step.

    Parameter Description
    Microservice Space Select a region and a microservice namespace.
    Policy name Enter a name for the policy. The name can be up to 64 characters in length.
    Framework Select Service Mesh.
  6. In the Select effective application step of the Create Outlier Instance Removal Policy wizard, select an application and click the > icon to add the application to the Selected Applications section. Then, click Next Step.
    Create Outlier Instance Removal Policy - Select effective application

    After the application is selected, the abnormal instances of all the applications that are called by this application can be removed. Call requests from this application are not distributed to the removed instances.

  7. In the Configure policies step of the Create Outlier Instance Removal Policy wizard, set the parameters and click Next Step.
    Create Outlier Instance Removal Policy - Multilingual applications

    The following table describes the parameters in the Configure policies step.

    Parameter Description
    Exception type Default value: 5XX Error. You cannot change the value of this parameter.
    Proportion of Largest Instances Enter the upper limit for the proportion of abnormal instances that can be removed. If the limit is reached, no more abnormal instances are removed. For example, an application has six instances in total. If you set this parameter to 60%, the maximum number of instances that can be removed is 3.6, which is rounded down to the nearest integer 3. The number is calculated by using the following formula: 6 × 60% = 3.6. If the calculated result is less than 1, no instances are removed.
    Recovery detection unit time Specify a unit interval to detect whether abnormal instances are recovered, in milliseconds. After abnormal instances are removed, EDAS linearly increases the detection interval by the specified unit interval. The default unit interval is 30,000 ms, which is equal to 0.5 minute.
    Number of Consecutive Errors Specify the threshold of the number of consecutive errors during requests. If the threshold is reached on an instance, the instance is removed.
    Maximum Connections Specify the maximum number of connections that are supported by a service. Default value: 1024.
    Maximum Pending Requests Specify the maximum number of pending requests that are supported by a service. Default value: 1024.
    Maximum Requests for a Single Connection Specify the maximum number of requests that are supported by a connection to a service. Default value: 1024.
  8. In the Create Confirm step of the Create Outlier Instance Removal Policy wizard, verify the settings and click Create.
    Confirm to create the outlier instance removal policy

Verify the result

The outlier instance removal feature is enabled after you configure and create an outlier instance removal policy. You can go to the details page of the application for which you have configured outlier instance removal to view the application monitoring information. For example, you can check whether call requests are still forwarded to abnormal instances and whether the error rate per minute for application calls is higher than the value of the Lower error rate limit parameter in a topology. This way, you can check whether the outlier instance removal policy takes effect.

What to do next

On the Outlier Instance Removal page, you can click Edit or Delete in the Operation column to manage the policies.