Updated on 2025-08-19 GMT+08:00

Modifying the Load Balancing Algorithm

If you configure one or more origin server addresses, you can use a load balancing algorithm to distribute traffic across these origin servers. WAF supports the following algorithms:

  • Origin server IP hash: Requests from the same IP address are routed to the same backend server.
  • Weighted round robin: All requests are distributed across origin servers in turn based on weights set to each origin server. The origin server with a larger weight receives more requests than others.
  • Session hash: Requests with the same session tag are routed to the same origin server. To enable this algorithm, configure traffic identifiers for known attack sources, or Session hash algorithm cannot take effect.

Constraints

  • This function is supported by cloud mode - CNAME and dedicated mode. If you use cloud mode - CNAME access, the service must be the professional or enterprise edition.
  • Configuring load balancing algorithms is supported in some regions. For details, see Functions.

Switching the Load Balancing Algorithm

  1. Log in to the WAF console.
  2. Click in the upper left corner and select a region or project.
  3. (Optional) If you have enabled the enterprise project function, in the upper part of the navigation pane on the left, select your enterprise project from the Filter by enterprise project drop-down list. Then, WAF will display the related security data in the enterprise project on the page.
  4. In the navigation pane on the left, click Website Settings.
  5. On the Website Settings page, click the target website domain name.
  6. In the Load Balancing Algorithm field, click Modify. In the dialog box displayed, select a load balancing algorithm and click OK.