All Products
Search
Document Center

Anti-DDoS:Configure session persistence

Last Updated:Feb 22, 2024

After you add non-website services to Anti-DDoS Pro or Anti-DDoS Premium, issues such as logon timeout or disconnections may occur. In this case, you can enable the session persistence feature. This feature forwards requests from the same client to the same backend server within a specified period. This topic describes how to configure session persistence for a port forwarding rule.

Prerequisites

A port forwarding rule for a non-website service is configured on the Port Config page. For more information, see Configure port forwarding rules.

Enable session persistence

  1. Log on to the Anti-DDoS Pro console.

  2. In the top navigation bar, select the region of your asset.

    • Anti-DDoS Proxy (Chinese Mainland): If your instance is an Anti-DDoS Pro instance, select Chinese Mainland.

    • Anti-DDoS Proxy (Outside Chinese Mainland): If your instance is an Anti-DDoS Premium instance, select Outside Chinese Mainland.

    You can switch the region to configure and manage Anti-DDoS Pro or Anti-DDoS Premium instances. Make sure that you select the required region when you use Anti-DDoS Pro or Anti-DDoS Premium.

  3. In the left-side navigation pane, choose Provisioning > Port Config.

  4. On the Port Config page, select the instance, find the forwarding rule that you want to manage, and then click Change in the Session Persistence column.
    Note You can also enable session persistence for more than one forwarding rule of an instance at a time. For more information, see Configure session persistence and health checks for more than one rule at a time.
    Port Config
  5. In the Session Persistence dialog box, set Timeout Period and click Complete. The timeout period is measured in seconds, and the valid value ranges from 30 to 3600.
    After the session persistence feature is enabled, the status of Session Persistence changes to Enabled.Enabled

Configure session persistence and health checks for more than one port forwarding rule

  1. Log on to the Anti-DDoS Pro console.

  2. In the top navigation bar, select the region of your asset.

    • Anti-DDoS Proxy (Chinese Mainland): If your instance is an Anti-DDoS Pro instance, select Chinese Mainland.

    • Anti-DDoS Proxy (Outside Chinese Mainland): If your instance is an Anti-DDoS Premium instance, select Outside Chinese Mainland.

    You can switch the region to configure and manage Anti-DDoS Pro or Anti-DDoS Premium instances. Make sure that you select the required region when you use Anti-DDoS Pro or Anti-DDoS Premium.

  3. In the left-side navigation pane, choose Provisioning > Port Config.

  4. On the Port Config page, select the instance that you want to manage and choose Batch Operations > Add Session and Health Check Settings.

  5. In the Add Session and Health Check Settings dialog box, enter the required information as shown in the sample file and click OK.

    Note

    You can export health check settings to a TXT file, modify the settings in the TXT file, and then copy and paste the settings to the Add Session and Health Check Settings dialog box. For more information, see Export configurations of multiple websites.

    The formats of session persistence and health check settings must meet the following requirements:

    • Each line represents a forwarding rule.

    • From left to right, the fields in each port forwarding rule indicate the following parameters: forwarding port, forwarding protocol, session persistence timeout period, health check type, port, response timeout period, check interval, unhealthy threshold, healthy threshold, health check path, and domain name. The supported forwarding protocols are TCP, HTTP, and UDP. The session persistence timeout period is measured in seconds, and the valid value ranges from 30 to 3600. Fields are separated by spaces.

    • Port forwarding ports must be the ports that are specified in port forwarding rules.

    • If a port forwarding rule uses UDP, we recommend that you configure a UDP health check. If a port forwarding rule uses TCP, we recommend that you configure a TCP health check (Layer 4 health check) or HTTP health check (Layer 7 health check).

    • If you configure an HTTP health check, the Health Check Path parameter is required, but the Domain Name parameter is optional.