Service degradation

更新时间:
复制 MD 格式

When server pressure increases, you can degrade certain non-essential services based on your business needs and traffic. Degrading a service means that you either do not process it or you process it in a simpler way. This frees up server resources to ensure that your core services operate normally.

How it works

Service degradation is implemented on the client side. When a client calls the server, the client immediately returns a degradation error code instead of sending a request to the server. You can degrade services at the service level or the method level. The process is as follows:服务降级.png

Configure a service degradation rule

  1. Log on to the SOFAStack console.

  2. In the navigation pane on the left, choose Middleware > Microservice Platform > Microservices > Service Administration, and then click the Service Degradation tab.

  3. Click Add Degradation Rule, and then configure the following parameters:

    Parameter

    Description

    Rule Name

    Enter a name for the degradation rule.

    Caller Application

    Degradation takes effect on the client. Enter or select the client application.

    Run Mode

    Set the run mode for the degradation rule. Valid values:

    • Block Mode: The degradation rule takes effect.

    • Monitor Mode: The degradation rule does not take effect. It only enables log printing in MOSN.

    Degraded Service

    Select or enter the name of the server-side service that the client references. An asterisk (*) indicates all services.

    Downgrade method

    Enter the name of the method to degrade. An asterisk (*) indicates all methods.

  4. Click Submit, and then click OK.

  5. In the list of degradation rules, change the status of the rule that you just created to On.

Edit a service degradation rule

You can edit an existing service degradation rule at any time. Changes take effect in real time after you submit them.

  1. On the Service Degradation tab, click the plus sign (+) to the left of the target application.

  2. Click Edit to the right of the target service degradation rule.

  3. Edit the service degradation rule as needed, and then click Submit.

Delete a service degradation rule

You can delete an existing service degradation rule. The deletion takes effect in real time. Proceed with caution.

  1. On the Service Degradation tab, click the plus sign (+) to the left of the target application.

  2. Click Delete to the right of the target service degradation rule.

  3. Click OK.