New versions are released continuously during application iterations. Before you release a new version, you can use throttling rules to verify the new version on a small number of instances. After the verification succeeds, you can upgrade the applications on all instances to the new version. You can use HSF and HTTP throttling rules. This topic describes the two throttling rules.

Prerequisites

Configure an HTTP throttling rule

You can specify the URL and use the Cookie value, Header value, or URL parameter to distribute the traffic based on the whitelist or the range of the remainder of Mod 100.

Notice If you configure HTTP throttling rules for multiple groups of an application, only the last throttling rule takes effect.
  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 the namespace to which the application to upgrade belongs from the Namespace drop-down list. Then, click the name of the application.
  3. On the application details page, click the Basic Information tab. In the Application Settings section, click Enable next to Traffic Management.
    If throttling is not enabled, you cannot configure HTTP throttling rules.
  4. On the Instance Information tab, click Traffic Adjustment in the upper-right corner of the canary instance group section and click HTTP Traffic Adjustment.
  5. In the Traffic Adjustment dialog box, select Enable the following configuration to control HTTP request traffic that enters the current application instance group.
  6. In the Traffic Adjustment dialog box, configure the parameters. Then, click Save.

    You can configure one of the following throttling rules for inbound traffic: Canary Release by Content and Canary Release by Ratio.

    • Canary Release by Content: distributes traffic that meets the configured rule to the canary instance group.
    • Canary Release by Ratio: distributes traffic to the canary instance group based on a specific proportion.
    The following list describes how to configure the two rules:
    • Configure the Canary Release by Content rule
      1. In the Traffic Adjustment dialog box, click the Canary Release by Content tab.
      2. On the tab, configure the parameters.
      Parameter Description
      path Enter the path in the HTTP requests for the service.
      Conditional Mode If multiple rules are configured, you must configure the conditions for these rules to take effect. Valid values: Meet All Following Conditions and Meet Any of Following Conditions.
      Conditions Parameter Type Valid values: Cookie, Header, and Parameter.
      Parameter Enter the parameter name. The name can be up to 64 characters in length. For more information about the writing specifications and examples, see throttling rule parameters.
      Conditions Select a condition. Valid values: =, !, =, >, <, >=, <=, White List, and Mod 100.
      Value Enter a value for the mod operation or list.
    • Configure the Canary Release by Ratio rule
      1. In the Traffic Adjustment dialog box, click the Canary Release by Ratio tab.
      2. On the tab, specify Traffic Ratio. The value must be a positive integer. Valid values: 1 to 100. Example: 40.

Configure an HSF throttling rule

You can specify a service or a method, use the parameter value of the method, and use the remainder range of Mod 100 or the list as the condition to distribute the traffic.

  1. On the Instance Information tab, click Traffic Adjustment in the upper-right corner of the canary instance group section and click HSF Traffic Adjustment.
  2. In the Traffic Adjustment dialog box, select Enable the following configuration to control the HSF request volume that comes into the current application instance group.
  3. In the Traffic Adjustment dialog box, configure the parameters. Then, click Save.
    You can configure one of the following throttling rules for inbound traffic: Canary Release by Content and Canary Release by Ratio.
    • Canary Release by Content: distributes traffic that meets the configured rule to the canary instance group.
      1. In the Traffic Adjustment dialog box, click the Grayscale by Content tab.
      2. On the tab, configure the parameters.
        Parameter Description
        Select Service Select a service in the ingress application from the drop-down list.
        Method Select a method in the service that you select in the ingress application. If you do not select a method, all requests that access the service are matched based on the rule.
        Conditional Mode If multiple rules are configured, you must configuire the conditions for these rules to take effect. Valid values: Meet All Following Conditions and Meet Any of Following Conditions.
        Conditions Parameter Parameters in the service and method are automatically listed and named in the format of parameteri. i indicates the serial number of the parameter. The serial number starts from 0.
        Expression for Getting Parameter Values The expression is concatenated by two fields in the format of argsi.xxx. The first field argsi depends on the parameter you select. If you select parameter0, the argsi field is args0. The second field .xxx is customized based on your requirements. For more information about the writing specifications and examples, see throttling rule parameters.
        Conditions Select a condition. Valid values: =, !, =, >, <, >=, <=, White List, and Mod 100.
        Value Enter a parameter value. A string must be enclosed in double quotation marks (""). If the value is of the BOOLEAN type, the valid value is true or false.
    • Canary Release by Ratio: distributes traffic to the canary instance group based on a specific proportion.
      1. In the Traffic Adjustment dialog box, click the Canary Release by Ratio tab.
      2. On the tab, specify Traffic Ratio. The value must be a positive integer. Valid values: 1 to 100. Example: 40.

Verify the throttling rule

After you configure and enable a throttling rule, you can monitor the canary traffic to verify whether the traffic destined for the canary instance group meets your expectations. For more information, see Monitor canary traffic.